Package net.sf.cindy

Examples of net.sf.cindy.Buffer.capacity()


        Buffer buffer = newBuffer(8);
        buffer.putInt(123);
        Buffer slice = buffer.slice();
        assertEquals(0, slice.position());
        assertEquals(4, slice.limit());
        assertEquals(4, slice.capacity());
        assertEquals(4, buffer.position());
        assertEquals(8, buffer.limit());
        assertEquals(8, buffer.capacity());

        int num = random.nextInt();
View Full Code Here


    public Buffer compact() {
        checkReadonly();

        Buffer buffer = BufferFactory.allocate(remaining());
        batch(true, getIndex(0), buffer, buffer.capacity());
        buffer.position(0);

        int index = getIndex(0, 0);
        Entry entry = getEntry(index);
        int offset = index - entry.position;
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.