Package org.apache.directmemory.memory.buffer

Examples of org.apache.directmemory.memory.buffer.MemoryBuffer.readerIndex()


        }

        pointer.hit();

        final MemoryBuffer buf = pointer.getMemoryBuffer();
        buf.readerIndex( 0 );

        final byte[] swp = new byte[(int) buf.readableBytes()];
        buf.readBytes( swp );
        return swp;
    }
View Full Code Here


    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;
    }
View Full Code Here

        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 );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.