private void updateChecksumAdj (ByteBuffer fontData) {
        int checksum = calculateChecksum ("", fontData);
        int checksumAdj = 0xb1b0afba - checksum;

        // find the head table
        int offset = 12 + (getNumTables () * 16);

        // find the head table
        for (Iterator i = tables.keySet ().iterator (); i.hasNext ();) {
            String tagString = (String) i.next ();

            // adjust the checksum
            if (tagString.equals ("head")) {
                fontData.putInt (offset + 8, checksumAdj);
                return;
            }

            // add the length of the entry 
            Object tableObj = tables.get (tagString);
            if (tableObj instanceof TrueTypeTable) {
                offset += ((TrueTypeTable) tableObj).getLength ();
            } else {
                offset += ((ByteBuffer) tableObj).remaining ();
            }

            // pad
            if ((offset % 4) != 0) {
                offset += (4 - (offset % 4));
            }
        }
    }