Examples of buf()


Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        assertEquals(127, duplicate.get(4));

        // Test a duplicate of a duplicate.
        original = IoBuffer.allocate(16);
        duplicate = original.duplicate().duplicate();
        assertNotSame(original.buf(), duplicate.buf());
        assertSame(original.buf().array(), duplicate.buf().array());

        // Try to expand.
        original = IoBuffer.allocate(16);
        original.setAutoExpand(true);
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        // Test a duplicate of a duplicate.
        original = IoBuffer.allocate(16);
        duplicate = original.duplicate().duplicate();
        assertNotSame(original.buf(), duplicate.buf());
        assertSame(original.buf().array(), duplicate.buf().array());

        // Try to expand.
        original = IoBuffer.allocate(16);
        original.setAutoExpand(true);
        duplicate = original.duplicate();
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        slice = original.slice();
        original.put(4, (byte) 127);
        assertEquals(0, slice.position());
        assertEquals(6, slice.limit());
        assertEquals(6, slice.capacity());
        assertNotSame(original.buf(), slice.buf());
        assertEquals(127, slice.get(0));
    }

    @Test
    public void testReadOnlyBuffer() throws Exception {
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        duplicate = original.asReadOnlyBuffer();
        original.put(4, (byte) 127);
        assertEquals(4, duplicate.position());
        assertEquals(10, duplicate.limit());
        assertEquals(16, duplicate.capacity());
        assertNotSame(original.buf(), duplicate.buf());
        assertEquals(127, duplicate.get(4));

        // Try to expand.
        try {
            original = IoBuffer.allocate(16);
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()


    public void encode( IoSession session, Object message, ProtocolEncoderOutput out )
    {
        IoBuffer buf = IoBuffer.allocate( 1024 );
        encoder.encode( buf.buf(), ( DhcpMessage ) message );

        buf.flip();

        out.write( buf );
    }
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        // make space for int length
        buf.putInt( 0 );

        if ( message instanceof KdcReply )
        {
            replyEncoder.encode( ( KdcReply ) message, buf.buf() );
        }
        else
        {
            if ( message instanceof ErrorMessage )
            {
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        }
        else
        {
            if ( message instanceof ErrorMessage )
            {
                errorEncoder.encode( ( ErrorMessage ) message, buf.buf() );
            }
        }

        // mark position
        int pos = buf.position();
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

    {
        IoBuffer buf = IoBuffer.allocate( 1024 );

        if ( message instanceof KdcReply )
        {
            replyEncoder.encode( ( KdcReply ) message, buf.buf() );
        }
        else
        {
            if ( message instanceof ErrorMessage )
            {
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        }
        else
        {
            if ( message instanceof ErrorMessage )
            {
                errorEncoder.encode( ( ErrorMessage ) message, buf.buf() );
            }
        }

        buf.flip();
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.buf()

        // make space for int length
        buf.putInt( 0 );

        if ( message instanceof ChangePasswordReply )
        {
            replyEncoder.encode( buf.buf(), ( ChangePasswordReply ) message );
        }
        else
        {
            if ( message instanceof ChangePasswordError )
            {
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.