decompression in c#
i have compressed an xml file and converted it into base64 format in web page.then i have开发者_运维技巧 passed the base64 string to windows application and converted it to unbase64 format.now i want to decompress this string in windows form only. i have done the following in windows
dim decoded as byte()
decoded=convert.frombase64string(strreturndata) // strreturndata is base64 string
dim decoders as string
decoders = encoding.utf8.getstring(decoded)
now i want to decompress this string using gzip stream class in windows form
If you want to get back the Base64 string, use this.
Try this:
byte[] x = Convert.FromBase64String(decodedString);
string mytext = System.Encoding.utf8.getstring(x, 0, x.length)
If you need to do more compression, you can use Gzip compression and decompression or DeflateStream class.
精彩评论