private void ensureXrefEntriesCapacity(int size) {
        if (xrefEntries == null || xrefEntries.length < size) {
            final PDFXrefEntry[] newXrefEntries = new PDFXrefEntry[size];
            if (xrefEntries != null) {
                System.arraycopy(xrefEntries, 0, newXrefEntries, 0, xrefEntries.length);
            }
            xrefEntries = newXrefEntries;
        }

    }