Wrapped GZipStream and ZlibStream in BufferedStream when reading
This commit is contained in:
parent
190b694668
commit
964821d1fc
|
@ -175,8 +175,8 @@ public static class NbtFile
|
||||||
return compression switch
|
return compression switch
|
||||||
{
|
{
|
||||||
CompressionType.None => stream,
|
CompressionType.None => stream,
|
||||||
CompressionType.GZip => new GZipStream(stream, CompressionMode.Decompress, false),
|
CompressionType.GZip => new BufferedStream(new GZipStream(stream, CompressionMode.Decompress, false)),
|
||||||
CompressionType.ZLib => new ZLibStream(stream, CompressionMode.Decompress),
|
CompressionType.ZLib => new BufferedStream(new ZLibStream(stream, CompressionMode.Decompress)),
|
||||||
_ => throw new ArgumentOutOfRangeException(nameof(compression), compression, null)
|
_ => throw new ArgumentOutOfRangeException(nameof(compression), compression, null)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue