I\'m looking for a LZW compression algorithm in C# that takes a \"string\" and returns a string. I\'ve googling for hours and all I\'ve found use MemoryStream, BinaryWriters, et
Given that LZW codes needn't necessarily fall on byte boundaries, simply converting the binary output of LZW compression to a UTF8 string (as with the StreamReader
approach) will most likely fail, producing illegal output.
It seems that the Javascript decompress function you refer to actually takes an array of numbers as its input. Probably the most efficient way to convey the binary output to the javascript decompress method would be to base64 encode the binary output, then to base64 decode at the JS end into a number array and to supply this to your method.
This might be of questionable efficiency. Worth testing before deploying.