KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
i'm querying a webservice in c# 4.0, which provides me with a string compressed by php's gzcompress() . Now i need to decompress this string in c#. I tried several ways including GZipStream decompression performance is poor C# to Java: Base64String, MemoryStream, GZipStream How to solve Gzip Magic Number Missing but everytime i get an "Missing Magic Number" exception. Can someone provide me with some hints? Thank you Edit 1: My latest try: public static string Decompress(string compressed) { byte[] compressedBytes = Encoding.ASCII.GetBytes(compressed); MemoryStream mem = new MemoryStream(compressedBytes); GZipStream gzip = new GZipStream(mem, CompressionMode.Decompress); StreamReader reader = new StreamReader(gzip); return reader.ReadToEnd(); }
Tags (comma-separated)
Save Edits
Cancel