Merge pull request #29 from Sitterr/master
Wrapping deflated streams in BufferedStream when reading
This commit is contained in:
commit
d6e0075b74
|
@ -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