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
Use something like this:
private string CompressToLZW(string input)
{
using (MemoryStream stream = new MemoryStream())
{
ComputeLZW(input, stream);
stream.Seek(0, SeekOrigin.Begin);
using (StreamReader reader = new StreamReader(stream))
{
return reader.ReadToEnd();
}
}
}
where ComputeLZW() is the LZW method you have that uses a stream.