Package org.activeio

Examples of org.activeio.Packet.capacity()


        packet.position(5);
        packet.limit(95);
        Packet packet2 = packet.slice();
       
        assertEquals(0, packet2.position());
        assertEquals(90, packet2.capacity());
        assertEquals(90, packet2.limit());
    }

    public void testWriteAndReadByte() {
       
View Full Code Here


abstract public class PacketTestSupport extends TestCase {
    abstract Packet createTestPacket(int capacity);
   
    public void testInit() {
        Packet packet = createTestPacket(100);
        assertEquals( 100, packet.capacity() );       
        assertEquals( 0, packet.position());       
        assertEquals( 100, packet.limit() );       
        assertEquals( 100, packet.remaining() );       
        assertTrue( packet.hasRemaining() );       
    }
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.