Package net.sf.cindy

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


            assertEquals(b2.get(), buffer.get());

        buffer.clear();
        buffer.limit(random.nextInt(buffer.capacity()));
        buffer.position(random.nextInt(buffer.limit()));
        buffer = buffer.slice();
        ByteBuffer b3 = buffer.asByteBuffer();
        assertEquals(buffer.position(), b3.position());
        assertEquals(buffer.limit(), b3.limit());
        assertEquals(buffer.capacity(), b3.capacity());
        while (b3.hasRemaining())
View Full Code Here


        assertEquals(-1, buffer.indexOf(pattern));

        buffer.clear();
        int randomPosition = random.nextInt(buffer.capacity());
        buffer.position(randomPosition);
        buffer = buffer.slice();
        assertEquals(0, buffer.indexOf(new byte[] { (byte) randomPosition }));
    }

    public void testDuplicate() {
        Buffer buffer = newBuffer(random.nextInt(100) + 8);
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.