Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// Uncompresses a gz file.
- /// </summary>
- /// <param name="filePath">The file path.</param>
- /// <param name="memStream">The memory stream.</param>
- void UncompressGzFile(string filePath, ref MemoryStream memStream) {
- using (var fStream = new FileStream(filePath, FileMode.Open))
- using (var zipStream = new GZipStream(fStream, CompressionMode.Decompress, false)) {
- zipStream.CopyTo(memStream = new MemoryStream());
- memStream.Position = 0; // Set position to beginning to prevent weird errors from happening throughout the application.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment