Package org.apache.mina.common

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


    }

    if (data.position() != 0) {
      data.flip();
    } else {
      data.rewind();
    }
    header.setSize(data.limit());

    final Header lastHeader = rtmp.getLastWriteHeader(channelId);
    final int headerSize = calculateHeaderSize(header, lastHeader);
View Full Code Here


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

    public void handle(final int channelId, final AMQVersionAwareProtocolSession session)
            throws AMQException
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.