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
You can "convert" a string into a MemoryStrem like this:
byte[] byteArray = Encoding.ASCII.GetBytes(youInputString);
MemoryStream stream = new MemoryStream(byteArray);
(make sure you understand which encoding you need).
The other way goes like this:
StreamReader reader = new StreamReader(methodOutputStream);
string text = reader.ReadToEnd();
To use the methods found on http://paste.lisp.org/display/12198, you can first convert your string to a Stream, feed it to the LZW compression methods, receive an output Stream, and convert that stream to a string. The only difference is that the code on the site uses FileStreams.