Package org.apache.mina.core.buffer

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


            if (writeRequest.getMessage() instanceof IoBuffer) {
                IoBuffer buffer = (IoBuffer) writeRequest.getMessage();
                // I/O processor implementation will call buffer.reset()
                // it after the write operation is finished, because
                // the buffer will be specified with messageSent event.
                buffer.mark();
                int remaining = buffer.remaining();
                if (remaining == 0) {
                    // Zero-sized buffer means the internal message
                    // delimiter.
                    s.increaseScheduledWriteMessages();
View Full Code Here


            if (writeRequest.getMessage() instanceof IoBuffer) {
                IoBuffer buffer = (IoBuffer) writeRequest.getMessage();
                // I/O processor implementation will call buffer.reset()
                // it after the write operation is finished, because
                // the buffer will be specified with messageSent event.
                buffer.mark();
                int remaining = buffer.remaining();

                if (remaining > 0) {
                    s.increaseScheduledWriteBytes(remaining);
                }
View Full Code Here

        private Object getMessageCopy(Object message) {
            Object messageCopy = message;
            if (message instanceof IoBuffer) {
                IoBuffer rb = (IoBuffer) message;
                rb.mark();
                IoBuffer wb = IoBuffer.allocate(rb.remaining());
                wb.put(rb);
                wb.flip();
                rb.reset();
                messageCopy = wb;
View Full Code Here

        buf.put((byte) 0xCD);
        buf.flip();

        buf.order(ByteOrder.LITTLE_ENDIAN);

        buf.mark();
        Assert.assertEquals(0xA4, buf.getUnsigned());
        buf.reset();
        Assert.assertEquals(0xD0A4, buf.getUnsignedShort());
        buf.reset();
        Assert.assertEquals(0xCDB3D0A4L, buf.getUnsignedInt());
View Full Code Here

        buf.put((byte) 0);
        buf.put((byte) 0);
        buf.put((byte) 0);

        // Position should be 3 when we reset this buffer.
        buf.mark();

        // Overflow it
        buf.put((byte) 0);
        buf.put((byte) 0);
View Full Code Here

            if (writeRequest.getMessage() instanceof IoBuffer) {
                IoBuffer buffer = (IoBuffer) writeRequest.getMessage();
                // I/O processor implementation will call buffer.reset()
                // it after the write operation is finished, because
                // the buffer will be specified with messageSent event.
                buffer.mark();
                int remaining = buffer.remaining();
                if (remaining == 0) {
                    // Zero-sized buffer means the internal message
                    // delimiter.
                    s.increaseScheduledWriteMessages();
View Full Code Here

        // holds the handshake type, default is un-encrypted
        byte handshakeByte = RTMPConnection.RTMP_NON_ENCRYPTED;
        //get the current message
        if (obj instanceof IoBuffer) {
          IoBuffer message = (IoBuffer) obj;
          message.mark();
          handshakeByte = message.get();
          message.reset();
        }
        //set the type
        handshake.setHandshakeType(handshakeByte);
View Full Code Here

                        return;
                    }

                    IoBuffer buf = (IoBuffer) message;
                   
                    buf.mark();

                    if (session.getFilterChain().contains("SSL")
                            && buf.remaining() == 1 && buf.get() == (byte) '.') {
                        LOGGER.info("TLS Reentrance");
                        ((SslFilter) session.getFilterChain().get("SSL"))
View Full Code Here

            if (writeRequest.getMessage() instanceof IoBuffer) {
                IoBuffer buffer = (IoBuffer) writeRequest.getMessage();
                // I/O processor implementation will call buffer.reset()
                // it after the write operation is finished, because
                // the buffer will be specified with messageSent event.
                buffer.mark();
                int remaining = buffer.remaining();

                if (remaining == 0) {
                    // Zero-sized buffer means the internal message
                    // delimiter.
View Full Code Here

        private Object getMessageCopy(Object message) {
            Object messageCopy = message;
            if (message instanceof IoBuffer) {
                IoBuffer rb = (IoBuffer) message;
                rb.mark();
                IoBuffer wb = IoBuffer.allocate(rb.remaining());
                wb.put(rb);
                wb.flip();
                rb.reset();
                messageCopy = wb;
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.