private void printData () {
        char[] parts = new char[17];
        int partsloc = 0;
        for (int i = 0; i < data.length; i++) {
            int d = ((int) data[i]) & 0xff;
            if (d == 0) {
                parts[partsloc++] = '.';
            } else if (d < 32 || d >= 127) {
                parts[partsloc++] = '?';
            } else {
                parts[partsloc++] = (char) d;
            }
            if (d < 16) {
                System.out.print ("0" + Integer.toHexString (d));
            } else {
                System.out.print (Integer.toHexString (d));
            }
            if ((i & 15) == 15) {
                System.out.println ("      " + new String (parts));
                partsloc = 0;
            } else if ((i & 7) == 7) {
                System.out.print ("  ");
                parts[partsloc++] = ' ';
            } else if ((i & 1) == 1) {
                System.out.print (" ");
            }
        }
        System.out.println ();
    }