public static void main(String[] args) {
        if (args.length < 1) {
            System.out.println("Usage:");
            System.out.println("    Type1Decode <filename> <decode-start>");
            System.exit(-1);
        }
    
        try {
            File file = new File(args[0]);
            
            if (!file.exists() || !file.canRead()) {
                System.out.println("Can't read file: " + args[0]);
                System.exit(-1);
            }
            
            FileInputStream fis = new FileInputStream(file);
            
            byte[] data = new byte[(int) file.length()];
            int cur = 0;
            while (cur < file.length()) {
                cur += fis.read(data, cur, data.length - cur);
            }
            
            int start = 0;
            
            if ((data[0] & 0xff)== 0x80) {
                start = (data[2] & 0xff);
                start |= (data[3] & 0xff) << 8;
                start |= (data[4] & 0xff) << 16;
                start |= (data[5] & 0xff) << 24;
                
                start += 6;
            } else if (args.length > 1) {
                start = Integer.parseInt(args[1]);
            } else {
                System.out.println("Unable to read size");
                System.exit(-1);
            }
            
            int size = data.length - start;
            
            if (isASCII(data, start)) {
                data = readASCII(data, start, size);
                start = 0;
                size = data.length;
            } else if((data[start] & 0xff) == 0x80) {
                size = (data[start + 2] & 0xff);
                size |= (data[start + 3] & 0xff) << 8;
                size |= (data[start + 4] & 0xff) << 16;
                size |= (data[start + 5] & 0xff) << 24;
                
                start += 6;
            }
            
            byte[] outData = decrypt(data, start, start + size, 55665, 4);
            
            HexDump.printData(outData);
            
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }