Created
May 7, 2018 15:55
-
-
Save richlander/ee710fe3dd9292f0273d39dc8ef28c8c to your computer and use it in GitHub Desktop.
Brotli Decompression
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static Stream DecompressWithBrotli(Stream toDecompress) | |
{ | |
MemoryStream decompressedStream = new MemoryStream(); | |
using (BrotliStream decompressionStream = new BrotliStream(toDecompress, CompressionMode.Decompress)) | |
{ | |
decompressionStream.CopyTo(decompressedFileStream); | |
} | |
return decompressedStream; | |
} | |
// Docs: https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.brotlistream?view=netcore-2.1 |
line 6 should be decompressionStream.CopyTo(decompressedStream);
See for a better example: https://gist.github.com/richlander/85217d18701b74363a46cd42c22220bd
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How does the data get into the variable decompressedStream when it is copied to the undeclared variable decompressedFileStream ?