mirror of https://github.com/2dust/v2rayN
简化代码
parent
6293ddacc6
commit
af71eed96e
|
@ -804,21 +804,14 @@ namespace v2rayN
|
||||||
|
|
||||||
public static string UnGzip(byte[] buf)
|
public static string UnGzip(byte[] buf)
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[1024];
|
MemoryStream sb = new MemoryStream();
|
||||||
int n;
|
using (GZipStream input = new GZipStream(new MemoryStream(buf),
|
||||||
using (MemoryStream sb = new MemoryStream())
|
CompressionMode.Decompress,
|
||||||
|
false))
|
||||||
{
|
{
|
||||||
using (GZipStream input = new GZipStream(new MemoryStream(buf),
|
input.CopyTo(sb);
|
||||||
CompressionMode.Decompress,
|
|
||||||
false))
|
|
||||||
{
|
|
||||||
while ((n = input.Read(buffer, 0, buffer.Length)) > 0)
|
|
||||||
{
|
|
||||||
sb.Write(buffer, 0, n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Encoding.UTF8.GetString(sb.ToArray());
|
|
||||||
}
|
}
|
||||||
|
return Encoding.UTF8.GetString(sb.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in New Issue