Search code examples
compressionsilverlight-4.0c#-4.0zipdeflate

Recommend a ZIP assembly for Silverlight 4


I've been using the Silverlight version of #ziplib (SharpZipLib) but it seems seriously flawed because the DeflateOutputStream always produces 2 bytes (120, 156) for any input (hell of a compression algorithm ;) so I cannot use that one. What's more it seems like that latest release is almost 2 years old now.

Any recommendation for a free (to be used in a commercial product) assembly that supports deflating streams?

Edit: The DotNetZip site says Silverlight support is deferred to the next release. Considering last *release* was last year and an alpha is in 'da hood' now we are likely to see something fruitful coming soon :)


Solution

  • Pardon me, but I was wrong about Silverlight SharpZipLib. It works fine if you remember to call Flush and Close on the DeflateOutputStream. I was using a MemoryStream for backing so I could compress data that I would upload to server. Thinking the data was lost if the stream was closed I didn't do so on purpose. That was until I discovered byte[] MemoryStream.ToArray().