Package org.activeio

Examples of org.activeio.Packet.position()


        assertFalse(packet.hasRemaining());
    }
   
    public void testFlip() {
        Packet packet = createTestPacket(100);
        packet.position(95);
        packet.flip();       
        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
    }
   
View Full Code Here


   
    public void testFlip() {
        Packet packet = createTestPacket(100);
        packet.position(95);
        packet.flip();       
        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
    }
   
    public void testClear() {
        Packet packet = createTestPacket(100);
View Full Code Here

        assertEquals(95, packet.limit());
    }
   
    public void testClear() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        packet.clear();       
        assertEquals(0, packet.position());
        assertEquals(100, packet.limit());
    }
View Full Code Here

    public void testClear() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        packet.clear();       
        assertEquals(0, packet.position());
        assertEquals(100, packet.limit());
    }

    public void testDuplicate() {
        Packet packet = createTestPacket(100);
View Full Code Here

        assertEquals(100, packet.limit());
    }

    public void testDuplicate() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.duplicate();
        packet2.position(10);
        packet2.limit(20);
       
View Full Code Here

    public void testDuplicate() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.duplicate();
        packet2.position(10);
        packet2.limit(20);
       
        assertEquals(5, packet.position());
        assertEquals(95, packet.limit());
        assertEquals(10, packet2.position());
View Full Code Here

        packet2.position(10);
        packet2.limit(20);
       
        assertEquals(5, packet.position());
        assertEquals(95, packet.limit());
        assertEquals(10, packet2.position());
        assertEquals(20, packet2.limit());
    }

    public void testRewind() {
        Packet packet = createTestPacket(100);
View Full Code Here

        assertEquals(20, packet2.limit());
    }

    public void testRewind() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        packet.rewind();
       
        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
View Full Code Here

        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        packet.rewind();
       
        assertEquals(0, packet.position());
        assertEquals(95, packet.limit());
    }
   
    public void testSlice() {
        Packet packet = createTestPacket(100);
View Full Code Here

        assertEquals(95, packet.limit());
    }
   
    public void testSlice() {
        Packet packet = createTestPacket(100);
        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.slice();
       
        assertEquals(0, packet2.position());
        assertEquals(90, packet2.capacity());
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.