/** * Interface that all compression suites must implement. That is they must be * able to compress a file and also reverse/decompress that process. * * @author Brian Lavallee * @since 5 November 2015 */ public interface Processor { public static final int BITS_PER_WORD = 8; public static final int BITS_PER_INT = 32; public static final int ALPH_SIZE = (1 << BITS_PER_WORD); // or 256 public static final int PSEUDO_EOF = ALPH_SIZE; public static final int HUFF_NUMBER = 0xface8200; /** * Compresses a file. Process must be reversible and loss-less. * * @param in * Buffered bit stream of the file to be compressed. * @param out * Buffered bit stream writing to the output file. */ public void compress(BitInputStream in, BitOutputStream out); /** * Decompresses a file. Output file must be identical bit-by-bit to the * original. * * @param in * Buffered bit stream of the file to be decompressed. * @param out * Buffered bit stream writing to the output file. */ public void decompress(BitInputStream in, BitOutputStream out); }