Skip to content

Commit

Permalink
Added BufferedStream for reading from DeflateStream - reduces loading… (
Browse files Browse the repository at this point in the history
#5924)

Co-authored-by: Martin Tomášek <tomasek@emclient.com>
  • Loading branch information
martintomasek and Martin Tomášek committed Oct 5, 2021
1 parent 510f011 commit 51c4984
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Microsoft.ML.Data/DataLoadSave/Binary/BinaryLoader.cs
Expand Up @@ -617,7 +617,8 @@ protected void EnsureValue()
stream.Seek(BlockOffset, SeekOrigin.Begin);
using (var subset = new SubsetStream(stream, BlockSize))
using (var decompressed = Compression.DecompressStream(subset))
using (var valueReader = _codec.OpenReader(decompressed, 1))
using (var bufferedStream = new BufferedStream(decompressed))
using (var valueReader = _codec.OpenReader(bufferedStream, 1))
{
valueReader.MoveNext();
valueReader.Get(ref Value);
Expand Down

0 comments on commit 51c4984

Please sign in to comment.