C
C#8mo ago
glacinefrox

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
glacinefrox
glacinefroxOP8mo 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
Want results from more Discord servers?
Add your server