Compressing and decompressing strings with BZip2 in .NET C#
August 29, 2017 Leave a comment
There are times when you need to return a large text from a web service. The large text will then need to be handled by the recipient. In order to reduce the size of the message you can combine two simple techniques:
- Compress the string value with a compression algorithm, such as BZip2
- Base64 encode the resulting byte array
You will be able to send the base 64 encoded compressed string over the wire.