I need to learn how to do Lempel–Ziv–Welch compression using pen and paper for my algorithms and data structures class. Unfortunately we have only a couple of examples in our book of how it is done. I'd like to practice compressing and decompressing text using it, but I need to find a way to check if I'm right doing it right or wrong. One of the options is make a program which will compress/decompress a string and show text. I know that it wouldn't be too difficult to make a program from zero and that it would be good learning experience, but I'd rather avoid making mistakes in implementation of algorithm.
So I'm looking for some preferably free/open source library which can compress and decompress LZW for C/C++/C#/Java.