import java.lang.Exception; import java.io.IOException; import java.io.PrintStream; class Comp{ public static void main (String args[]) throws java.lang.Exception { String fileName, funcType; IO.Compressor ioc; IO.Decompressor iod; try { funcType = args[0]; fileName = args[1]; if(funcType.equals("c") || funcType.equals("C")) // compress file { ioc = new IO.Compressor(fileName); ioc.encode(1,'a'); ioc.encode(2,'c'); ioc.encode(3,'d'); ioc.encode(4,'h'); ioc.done(); } else if(funcType.equals("d") || funcType.equals("D")) // decompress file { iod = new IO.Decompressor(fileName); iod.done(); } } catch(ArrayIndexOutOfBoundsException aE) { System.out.println("Thrown to indicate that an array has been accessed with an illegal index." + aE.getMessage()); } }// end of main