private static long[] addToLongArray(long[] destination, int offset, int destinationlength,
            long value, int increments) {
        int newlength = destinationlength;
        if (offset + 1 == newlength) {
            newlength += increments;
            long temp[] = new long[newlength];
            System.arraycopy(destination, 0, temp, 0, offset);
            destination = temp;
        }
        destination[offset] = value;
        return destination;
    }
private static long [ ] addToLongArray ( long [ ] destination , int offset , int destinationlength , long value , int increments ) { int newlength = destinationlength ; if ( offset + 1 == newlength ) { newlength += increments ; long temp [ ] = new long [ newlength ] ; System . arraycopy ( destination , 0 , temp , 0 , offset ) ; destination = temp ; } destination [ offset ] = value ; return destination ; }
Direct port of ICU4C static int64_t * addTouint64_tArray(...) in usearch.cpp.
This is used for appending a PCE to Pattern.PCE_ buffer. We probably should
implement this in Pattern class.

@param destination target array
@param offset destination offset to add value
@param destinationlength target array size
@param value to be added
@param increments incremental size expected
@return new destination array, destination if there was no new allocation