/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Reset the buffer to 0 size */ public void reset() { setCapacity(0); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Change the capacity of the backing store to be the same as the current * count of buffer. */ public void truncate() { setCapacity(count); }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Append specified bytes to the buffer. * * @param bytes byte array to be appended * @param offset offset into byte array * @param length length of data */ public void append(byte[] bytes, int offset, int length) { setCapacity(count+length); System.arraycopy(bytes, offset, this.get(), count, length); count = count + length; }
/** * Test of getCapacity method, of class org.apache.hadoop.record.Buffer. */ public void testGetCapacity() { final Buffer instance = new Buffer(); final int expResult = 0; final int result = instance.getCapacity(); assertEquals("getCapacity failed", expResult, result); instance.setCapacity(100); assertEquals("setCapacity failed", 100, instance.getCapacity()); }
/** * Test of truncate method, of class org.apache.hadoop.record.Buffer. */ public void testTruncate() { final Buffer instance = new Buffer(); instance.setCapacity(100); assertEquals("setCapacity failed", 100, instance.getCapacity()); instance.truncate(); assertEquals("truncate failed", 0, instance.getCapacity()); }