Last active
August 29, 2015 14:03
-
-
Save jzebedee/334d169b14b63f939b8b to your computer and use it in GitHub Desktop.
Zlib test
This file contains 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
var strTest = "The quick brown fox jumps over the lazy dog"; | |
var bufTest = Encoding.Default.GetBytes(strTest); | |
using (var msBufTest = new MemoryStream(bufTest)) | |
{ | |
var compressedBytes = Zlib.Compress(msBufTest); | |
using (var msCompressedBytes = new MemoryStream(compressedBytes)) | |
{ | |
var decompressedBytes = Zlib.Decompress(msCompressedBytes, (uint)compressedBytes.Length); | |
var strDecompressed = Encoding.Default.GetString(decompressedBytes); | |
System.Diagnostics.Debug.Assert(strTest == strDecompressed); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment