private void ensureXrefSize(final int size) {
        if (size == 0)
            return;
        if (xref == null)
            xref = new long[size];
        else {
            if (xref.length < size) {
                long xref2[] = new long[size];
                System.arraycopy(xref, 0, xref2, 0, xref.length);
                xref = xref2;
            }
        }
    }