DynByteBuffer { public final int getSize() { return buffer.length; } DynByteBuffer();  DynByteBuffer(final byte[] data);  DynByteBuffer(final InputStream inputStream);  DynByteBuffer(final byte[] data, final boolean copyOnWrite);  DynByteBuffer(final byte[] data, final boolean copyOnWrite, final int initialOffset);  DynByteBuffer(final long initSize); final void append(final boolean value); final void append(final byte value); final void append(final byte[] array, final boolean saveLength); final void append(final byte[] array, final int offset); final void append(final byte[] array, final int offset, final int length); final byte[] toArray(); final byte[] toArray(final int offset); final void init(); final void append(final int value); final void append(final float value); final void append(final double value); final void append(final long value); final void append(final Long value); final void append(final String value); final int getSize(); final int getLength(); final boolean isEmpty(); final void resetPosition(); final void resetPosition(final int pos); final void clear(); final int getNextInt(); final float getNextFloat(); final double getNextDouble(); final long getNextLong(); final byte getNextByte(); final int getNextByteAsInt(); final boolean getNextBoolean(); final byte[] getNextByteArray(); final String getNextString(); final byte[] getNextByteArray(final int length); final void setBuffer(final byte[] data); final void append(final InputStream inputStream); final synchronized void setBuffer(final byte[] data, final boolean copyOnWrite);  }
@Test public void testGetSize() { buffer = new DynByteBuffer(100); assertEquals(100, buffer.getSize()); byte [] test = new byte [120]; Random random = new Random(); random.nextBytes(test); buffer.append(test, false); assertTrue(buffer.getSize() > 100); }
@Test public void testDynByteBufferInt() { buffer = new DynByteBuffer(1337); assertNotNull(buffer); assertTrue(buffer.getSize() == 1337); }