/** A instance of this class has methods that perform LZW compression and ** decompression. It assumes that the source alphabet is comprised of the ** 128 ASCII chars. (Hence, it can compress/decompress only text files.) ** ** @author and R. McCloskey ** @version December 2006 */ import java.io.*; import java.util.HashMap; // to represent dictionary in compress() import java.util.ArrayList; // to represent dictionary in decompress() public class LZWForText { /** */ public void compress(InputStream input, OutputStream output) throws IOException { // for doing bit-oriented writing BitOutputStream bos = new BitOutputStream(output); /* initialize the dictionary to contain an entry for each ** length one string corresponding to an ASCII character */ /* read the input data from 'input' and ** write its compressed form to 'bos' */ } /** */ public void decompress(InputStream input, OutputStream output) throws IOException { // for doing bit-oriented reading (as opposed to byte-oriented) BitInputStream bis = new BitInputStream(input); // for doing character-oriented writing (as opposed to byte-oriented) PrintWriter pw = new PrintWriter(output); /* initialize the dictionary to contain an entry for each ** length one string corresponding to an ASCII character */ /* read the input data from 'bis' and ** write its decompressed form to 'pw' */ } }