@Test public void store() { int size = 100; final long expiry = System.currentTimeMillis(); byte[] expectedBytes = new byte[size]; random.nextBytes(expectedBytes); Pointer pointer = buffer.store(expectedBytes, expiry); byte[] actualBytes = buffer.retrieve(pointer); assertArrayEquals(expectedBytes, actualBytes); }
public Pointer store(final byte[] payload, final long expiry) { final Allocation allocation = allocate(payload); return store(allocation, payload, expiry); }
OffHeapByteBuffer implements OffHeapStore { public Pointer store(final byte[] payload, final long expiry) { final Allocation allocation = allocate(payload); return store(allocation, payload, expiry); } }
OffHeapByteBuffer implements OffHeapStore { public Pointer store(final byte[] payload, final long expiry) { final Allocation allocation = allocate(payload); return store(allocation, payload, expiry); } OffHeapByteBuffer(int index, int capacity);  OffHeapByteBuffer(int index, int capacity, int concurrencyLevel); }
OffHeapByteBuffer implements OffHeapStore { public Pointer store(final byte[] payload, final long expiry) { final Allocation allocation = allocate(payload); return store(allocation, payload, expiry); } OffHeapByteBuffer(int index, int capacity);  OffHeapByteBuffer(int index, int capacity, int concurrencyLevel); byte[] retrieve(final Pointer pointer); byte[] remove(Pointer pointer); Pointer store(final byte[] payload, final long expiry); Pointer store(final Allocation allocation, byte[] payload, final long expiry); Pointer update(final Pointer pointer, final byte[] payload, final long expiry); void free(); long dirtyMemory(); long usedMemory(); long freeMemory(); int getIndex(); }
OffHeapByteBuffer implements OffHeapStore { public Pointer store(final byte[] payload, final long expiry) { final Allocation allocation = allocate(payload); return store(allocation, payload, expiry); } OffHeapByteBuffer(int index, int capacity);  OffHeapByteBuffer(int index, int capacity, int concurrencyLevel); byte[] retrieve(final Pointer pointer); byte[] remove(Pointer pointer); Pointer store(final byte[] payload, final long expiry); Pointer store(final Allocation allocation, byte[] payload, final long expiry); Pointer update(final Pointer pointer, final byte[] payload, final long expiry); void free(); long dirtyMemory(); long usedMemory(); long freeMemory(); int getIndex(); final static int DEFAULT_CONCURRENCY_LEVEL; }