Package org.apache.mina.common

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


        }
        else
        {
            ByteBuffer data = buffer.slice();
            data.limit(length);
            data.rewind();
            buffer.skip(length);

            return new AMQShortString(data);
        }
    }
View Full Code Here


        else
        {
            final int size = length();
            byte[] b = new byte[size];
            ByteBuffer buf = _data.duplicate();
            buf.rewind();
            buf.get(b);

            return b;
        }
View Full Code Here

    public void writePayload(ByteBuffer buffer)
    {
        if (payload != null)
        {
            ByteBuffer copy = payload.duplicate();
            buffer.put(copy.rewind());
        }
    }

    protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
    {
View Full Code Here

        }

        public void messageSent( IoSession session, Object message ) throws Exception
        {
            ByteBuffer buffer = ( ByteBuffer ) message;
            buffer.rewind();
            byte[] data = new byte[ buffer.remaining() ];
            buffer.get( data );
            StringBuffer sb = ( StringBuffer ) session.getAttribute( "sent" );
            sb.append( new String( data, "ASCII" ) );
        }
View Full Code Here

        }

        public void messageSent( IoSession session, Object message ) throws Exception
        {
            ByteBuffer buffer = ( ByteBuffer ) message;
            buffer.rewind();
            byte[] data = new byte[ buffer.remaining() ];
            buffer.get( data );
            StringBuffer sb = ( StringBuffer ) session.getAttribute( "sent" );
            sb.append( new String( data, "ASCII" ) );
        }
View Full Code Here

        }

        public void messageSent(IoSession session, Object message)
                throws Exception {
            ByteBuffer buffer = (ByteBuffer) message;
            buffer.rewind();
            byte[] data = new byte[buffer.remaining()];
            buffer.get(data);
            StringBuffer sb = (StringBuffer) session.getAttribute("sent");
            sb.append(new String(data, "ASCII"));
        }
View Full Code Here

        }

        public void messageSent( IoSession session, Object message ) throws Exception
        {
            ByteBuffer buffer = ( ByteBuffer ) message;
            buffer.rewind();
            byte[] data = new byte[ buffer.remaining() ];
            buffer.get( data );
            StringBuffer sb = ( StringBuffer ) session.getAttribute( "sent" );
            sb.append( new String( data, "ASCII" ) );
        }
View Full Code Here

        if (payload != null)
        {
            if(payload.isDirect() || payload.isReadOnly())
            {           
                ByteBuffer copy = payload.duplicate();
                buffer.put(copy.rewind());
            }
            else
            {
                buffer.put(payload.array(),payload.arrayOffset(),payload.limit());
            }
View Full Code Here

    public void writePayload(ByteBuffer buffer)
    {
        if (payload != null)
        {
            ByteBuffer copy = payload.duplicate();
            buffer.put(copy.rewind());
        }
    }

    protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
    {
View Full Code Here

        }

        public void messageSent( IoSession session, Object message ) throws Exception
        {
            ByteBuffer buffer = ( ByteBuffer ) message;
            buffer.rewind();
            byte[] data = new byte[ buffer.remaining() ];
            buffer.get( data );
            StringBuffer sb = ( StringBuffer ) session.getAttribute( "sent" );
            sb.append( new String( data, "ASCII" ) );
        }
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.