public int getIndexSize (int loc) {
        //	System.out.println("Getting size of index at "+loc);
        int hold = pos;
        pos = loc;
        int count = readInt (2);
        if (count <= 0) {
            return 2;
        }
        int encsz = readByte ();
        if (encsz < 1 || encsz > 4) {
            throw new RuntimeException ("Offsize: " + encsz +
                    ", must be in range 1-4.");
        }
        // pos is now at the first offset.  last offset is at count*encsz
        pos += count * encsz;
        int end = readInt (encsz);
        pos = hold;
        return 2 + (count + 1) * encsz + end;
    }