/** * Appends an element to the vector. * @param element the element to append */ public void push(byte element) { reserveAdditional(1); data[len++] = element; }
/** * Appends the bytes from another byte array to this vec. * @param values the values to append * @param offset the offset into {@code values} to append from * @param len the number of bytes from {@code values} to append */ public void append(byte[] values, int offset, int len) { reserveAdditional(len); System.arraycopy(values, offset, this.data, this.len, len); this.len += len; }
copy.reserveAdditional(unused); assertEquals(vec.capacity(), copy.capacity()); copy.reserveAdditional(unused + 1); assertTrue(copy.capacity() > vec.capacity());