Package org.apache.mina.common

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


                    // SSL encrypt
                    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)) {
                        SessionLog.debug(session, " encrypted 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();
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

        }
       
        ByteBuffer buf = ByteBuffer.allocate( objectSize + 4, false );
        buf.putInt( objectSize );
        in.readFully( buf.array(), 4, objectSize );
        buf.position( 0 );
        buf.limit( objectSize + 4 );
       
        Object answer = buf.getObject( classLoader );
        buf.release();
        return answer;
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

            data = ByteBuffer.allocate(0);
        }

        if (debug)
        {
            _logger.debug("Creating message from buffer with position=" + data.position() + " and remaining=" + data
                    .remaining());
        }
        AMQMessageDelegate delegate = new AMQMessageDelegate_0_10(msgProps, deliveryProps, messageNbr);

        AbstractJMSMessage message = createMessage(delegate, data);
View Full Code Here

        {
            if(buffer.isDirect() || buffer.isReadOnly())
            {
                ByteBuffer encodedForm = _encodedForm.duplicate();

                if (encodedForm.position() != 0)
                {
                    encodedForm.flip();
                }

                buffer.put(encodedForm);
View Full Code Here

                    // SSL encrypt
                    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.