Package org.apache.mina.common

Examples of org.apache.mina.common.ByteBuffer.position()


            data = ByteBuffer.allocate(0);
        }

        if (debug)
        {
            _logger.debug("Creating message from buffer with position=" + data.position() + " and remaining=" + data
                    .remaining());
        }
        // set the properties of this message
        MessageProperties mprop = (MessageProperties) contentHeader[0];
        DeliveryProperties devprop = (DeliveryProperties) contentHeader[1];
View Full Code Here


                    if( SessionLog.isDebugEnabled( session ) )
                    {
                        SessionLog.debug( session, " encrypt: " + buf );
                    }
                   
                    int pos = buf.position();
                    handler.encrypt( buf.buf() );
                    buf.position( pos );
                    ByteBuffer encryptedBuffer = new EncryptedBuffer(
                            SSLHandler.copy( handler.getOutNetBuffer() ), buf );
   
View Full Code Here

                        SessionLog.debug( session, " encrypt: " + buf );
                    }
                   
                    int pos = buf.position();
                    handler.encrypt( buf.buf() );
                    buf.position( pos );
                    ByteBuffer encryptedBuffer = new EncryptedBuffer(
                            SSLHandler.copy( handler.getOutNetBuffer() ), buf );
   
                    if( SessionLog.isDebugEnabled( session ) )
                    {
View Full Code Here

        String value = message.toString();
        ByteBuffer buf = ByteBuffer.allocate(value.length())
                .setAutoExpand(true);
        buf.putString(value, encoder);
        if (buf.position() > maxLineLength) {
            throw new IllegalArgumentException("Line length: " + buf.position());
        }
        buf.putString(delimiter.getValue(), encoder);
        buf.flip();
        out.write(buf);
View Full Code Here

        String value = message.toString();
        ByteBuffer buf = ByteBuffer.allocate(value.length())
                .setAutoExpand(true);
        buf.putString(value, encoder);
        if (buf.position() > maxLineLength) {
            throw new IllegalArgumentException("Line length: " + buf.position());
        }
        buf.putString(delimiter.getValue(), encoder);
        buf.flip();
        out.write(buf);
    }
View Full Code Here

        try
        {
            for( ;; )
            {
                int oldPos = buf.position();
                boolean decoded = doDecode( session, buf, out );
                if( decoded )
                {
                    if( buf.position() == oldPos )
                    {
View Full Code Here

            {
                int oldPos = buf.position();
                boolean decoded = doDecode( session, buf, out );
                if( decoded )
                {
                    if( buf.position() == oldPos )
                    {
                        throw new IllegalStateException(
                                "doDecode() can't return true when buffer is not consumed." );
                    }
                   
View Full Code Here

        }
       
        String value = message.toString();
        ByteBuffer buf = ByteBuffer.allocate( value.length() ).setAutoExpand( true );
        buf.putString( value, encoder );
        if( buf.position() > maxLineLength )
        {
            throw new IllegalArgumentException( "Line length: " + buf.position() );
        }
        buf.putString( delimiter.getValue(), encoder );
        buf.flip();
View Full Code Here

        String value = message.toString();
        ByteBuffer buf = ByteBuffer.allocate( value.length() ).setAutoExpand( true );
        buf.putString( value, encoder );
        if( buf.position() > maxLineLength )
        {
            throw new IllegalArgumentException( "Line length: " + buf.position() );
        }
        buf.putString( delimiter.getValue(), encoder );
        buf.flip();
        out.write( buf );
    }
View Full Code Here

                if( SessionLog.isDebugEnabled( session ) )
                {
                    SessionLog.debug( session, " encrypt: " + buf );
                }
               
                int pos = buf.position();
                handler.encrypt( buf.buf() );
                buf.position( pos );
                ByteBuffer encryptedBuffer = new EncryptedBuffer(
                        SSLHandler.copy( handler.getOutNetBuffer() ), buf );
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.