163164165166167168169170171172173
} pointer.hit(); final MemoryBuffer buf = pointer.getMemoryBuffer(); buf.readerIndex( 0 ); final byte[] swp = new byte[(int) buf.readableBytes()]; buf.readBytes( swp ); return swp; }
102103104105106107108109110111112
public byte[] retrieve( Pointer<V> pointer ) { final byte[] swp = new byte[(int) pointer.getSize()]; MemoryBuffer memoryBuffer = pointer.getMemoryBuffer(); memoryBuffer.readerIndex( 0 ); memoryBuffer.readBytes( swp ); return swp; }
7980818283848586878889
logger.info( "allocated" ); assertNotNull( p ); assertNotNull( b ); // assertTrue( b.isDirect() ); assertEquals( 0, b.readerIndex() ); assertEquals( size, b.capacity() ); byte[] check = MemoryManager.retrieve( p ); assertNotNull( check );