Skip to content

Commit

Permalink
Merge pull request #29 from Sitterr/master
Browse files Browse the repository at this point in the history
Wrapping deflated streams in BufferedStream when reading
  • Loading branch information
ForeverZer0 authored Mar 15, 2024
2 parents 190b694 + 964821d commit d6e0075
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SharpNBT/NbtFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ private static Stream GetReadStream(string path, CompressionType compression)
return compression switch
{
CompressionType.None => stream,
CompressionType.GZip => new GZipStream(stream, CompressionMode.Decompress, false),
CompressionType.ZLib => new ZLibStream(stream, CompressionMode.Decompress),
CompressionType.GZip => new BufferedStream(new GZipStream(stream, CompressionMode.Decompress, false)),
CompressionType.ZLib => new BufferedStream(new ZLibStream(stream, CompressionMode.Decompress)),
_ => throw new ArgumentOutOfRangeException(nameof(compression), compression, null)
};
}
Expand Down

0 comments on commit d6e0075

Please sign in to comment.