package edu.cmu.cs211.compression.lzw; import java.io.IOException; import java.util.HashMap; import java.util.Map; import edu.cmu.cs211.compression.Compressor; import edu.cmu.cs211.compression.io.BitReader; import edu.cmu.cs211.compression.io.BitWriter; /** * A compressor implementing LZW compression */ public class LempelZivCompressor extends Compressor { /** The number of bits in each LZW code */ private static final int BIT_WIDTH = 16; /** The maximum number of codes */ private static final int MAX_SIZE = (1 << 16) - 1; // @see Compressor#compress(io.BitReader, io.BitWriter) @Override public void compress (BitReader in, BitWriter out) throws IOException { throw new RuntimeException ("You need to implement this method"); // don't forget to flush } // @see Compressor#expand(io.BitReader, io.BitWriter) @Override public void expand (BitReader in, BitWriter out) throws IOException { throw new RuntimeException ("You need to implement this method"); // don't forget to flush! } }