Parsing GZip Stream Without Looking Back

General News

Summary

Some files can exist in two equivalent forms – compressed and uncompressed. To open a compressed file in C#, you could pass it to GZipStream – it works flawlessly. However, you just consumed 2 bytes and simply handing over file stream to GZipStream will no longer work. For and many more transparently compressed formats, you can simply decide to skip into bread-and-butter of encryption – deflate algorithm. If you move just additional 8 bytes (thus skipping a total of 10), you can use DeflateStream and forget about “rewinding.” Wanna see example?

AskAI Classifications

Sectors
No sectors detected
Functions
Developer and IT Infrastructure Security Development Platforms

Linked Companies

GitHub, Inc.
$1M to $5M