DirectBuffer extends ByteBufferBuffer { public static DirectBuffer allocate() { return allocate(DEFAULT_INITIAL_CAPACITY, MAX_SIZE); } protected  DirectBuffer(
      final DirectBytes bytes, final int offset, final int initialCapacity, final int maxCapacity); static DirectBuffer allocate(); static DirectBuffer allocate(final int initialCapacity); static DirectBuffer allocate(final int initialCapacity, final int maxCapacity); @Override DirectBuffer duplicate();  }
@Test public void testByteBufferToDirectBuffer() { final ByteBuffer byteBuffer = ByteBuffer.allocate(8); byteBuffer.putLong(10); byteBuffer.flip(); final DirectBuffer directBuffer = DirectBuffer.allocate(8); directBuffer.write(byteBuffer.array()); directBuffer.flip(); assertEquals(directBuffer.readLong(), byteBuffer.getLong()); assertTrue(directBuffer.isDirect()); directBuffer.release(); }