C
C#3mo ago
≽ܫ≼

Read brotli stream in chunks

There is a way of putting as input the original data to a new brotli stream and read in chunks the compressed data
using (var compStream = new BrotliStream(myfilestream, CompressionLevel.SmallestSize, true))
{compStream.read(23939 byte)
}
using (var compStream = new BrotliStream(myfilestream, CompressionLevel.SmallestSize, true))
{compStream.read(23939 byte)
}
1 Reply
≽ܫ≼
≽ܫ≼3mo ago
if (compressed)
{
Stream originalStream = stream;

stream = new BrotliStream(originalStream, CompressionMode.Decompress);
}
if (compressed)
{
Stream originalStream = stream;

stream = new BrotliStream(originalStream, CompressionMode.Decompress);
}
i want to decompress but writing myself the chunks and directly to a filestream without having to fully download first the compresssed data and then do the copytoasync like creatin stream = new BrotliStream(originalStream, CompressionMode.Decompress); and then write to the stream and auto writes to the originalstream already decompresed