Merge pull request #29 from Sitterr/master

Wrapping deflated streams in BufferedStream when reading
This commit is contained in:
ForeverZer0 2024-03-14 20:55:53 -04:00 committed by GitHub
commit d6e0075b74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}; };
} }