Class ResetLimitWrappedActiveMQBuffer

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Sets the readerIndex and writerIndex of this buffer to 0.
      void readerIndex​(int readerIndex)
      Sets the readerIndex of this buffer.
      void resetReaderIndex()
      Repositions the current readerIndex to the marked readerIndex in this buffer.
      void resetWriterIndex()
      Repositions the current writerIndex to the marked writerIndex in this buffer.
      void setByte​(int index, byte value)
      Sets the specified byte at the specified absolute index in this buffer.
      void setBytes​(int index, byte[] src)
      Transfers the specified source array's data to this buffer starting at the specified absolute index.
      void setBytes​(int index, byte[] src, int srcIndex, int length)
      Transfers the specified source array's data to this buffer starting at the specified absolute index.
      void setBytes​(int index, ByteBuffer src)
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit.
      void setBytes​(int index, ActiveMQBuffer src)
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the destination becomes unreadable.
      void setBytes​(int index, ActiveMQBuffer src, int length)
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
      void setBytes​(int index, ActiveMQBuffer src, int srcIndex, int length)
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index.
      void setChar​(int index, char value)
      Sets the specified char at the specified absolute index in this buffer.
      void setDouble​(int index, double value)
      Sets the specified double at the specified absolute index in this buffer.
      void setFloat​(int index, float value)
      Sets the specified float at the specified absolute index in this buffer.
      void setIndex​(int readerIndex, int writerIndex)
      Sets the readerIndex and writerIndex of this buffer in one shot.
      void setInt​(int index, int value)
      Sets the specified 32-bit integer at the specified absolute index in this buffer.
      void setLong​(int index, long value)
      Sets the specified 64-bit long integer at the specified absolute index in this buffer.
      void setMessage​(Message message)
      We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions, for that reason this method will set the message to null here
      void setShort​(int index, short value)
      Sets the specified 16-bit short integer at the specified absolute index in this buffer.
      void writeBoolean​(boolean val)
      Sets the specified boolean at the current writerIndex
      void writeByte​(byte value)
      Sets the specified byte at the current writerIndex and increases the writerIndex by 1 in this buffer.
      void writeBytes​(byte[] src)
      Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= src.length).
      void writeBytes​(byte[] src, int srcIndex, int length)
      Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
      void writeBytes​(io.netty.buffer.ByteBuf src, int srcIndex, int length)
      Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
      void writeBytes​(ByteBuffer src)
      Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
      void writeBytes​(ActiveMQBuffer src, int length)
      Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
      void writeBytes​(ActiveMQBuffer src, int srcIndex, int length)
      Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
      void writeChar​(char chr)
      Sets the specified char at the current writerIndex and increases the writerIndex by 2 in this buffer.
      void writeDouble​(double value)
      Sets the specified double at the current writerIndex and increases the writerIndex by 8 in this buffer.
      void writeFloat​(float value)
      Sets the specified float at the current writerIndex and increases the writerIndex by 4 in this buffer.
      void writeInt​(int value)
      Sets the specified 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
      void writeLong​(long value)
      Sets the specified 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
      void writeNullableBoolean​(Boolean val)
      Sets the specified (potentially null) Boolean at the current writerIndex
      void writeNullableInt​(Integer value)
      Sets the specified (potentially null) 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
      void writeNullableLong​(Long value)
      Sets the specified (potentially null) 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
      void writeNullableSimpleString​(SimpleString val)
      Sets the specified SimpleString (potentially null) at the current writerIndex
      void writeNullableString​(String val)
      Sets the specified String (potentially null) at the current writerIndex
      void writerIndex​(int writerIndex)
      Sets the writerIndex of this buffer.
      void writeShort​(short value)
      Sets the specified 16-bit short integer at the current writerIndex and increases the writerIndex by 2 in this buffer.
      void writeSimpleString​(SimpleString val)
      Sets the specified non-null SimpleString at the current writerIndex
      void writeString​(String val)
      Sets the specified non-null String at the current writerIndex
      void writeUTF​(String utf)
      Sets the specified UTF-8 String at the current writerIndex
    • Constructor Detail

      • ResetLimitWrappedActiveMQBuffer

        public ResetLimitWrappedActiveMQBuffer​(int limit,
                                               ActiveMQBuffer buffer,
                                               Message message)
      • ResetLimitWrappedActiveMQBuffer

        public ResetLimitWrappedActiveMQBuffer​(int limit,
                                               io.netty.buffer.ByteBuf buffer,
                                               Message message)
    • Method Detail

      • setMessage

        public void setMessage​(Message message)
        We need to turn of notifications of body changes on reset on the server side when dealing with AMQP conversions, for that reason this method will set the message to null here
        Parameters:
        message -
      • clear

        public void clear()
        Description copied from interface: ActiveMQBuffer
        Sets the readerIndex and writerIndex of this buffer to 0. This method is identical to setIndex(0, 0).

        Please note that the behavior of this method is different from that of NIO buffer, which sets the limit to the capacity of the buffer.

        Specified by:
        clear in interface ActiveMQBuffer
        Overrides:
        clear in class ChannelBufferWrapper
      • setIndex

        public void setIndex​(int readerIndex,
                             int writerIndex)
        Description copied from interface: ActiveMQBuffer
        Sets the readerIndex and writerIndex of this buffer in one shot. This method is useful when you have to worry about the invocation order of ActiveMQBuffer.readerIndex(int) and ActiveMQBuffer.writerIndex(int) methods. For example, the following code will fail:
         // Create a buffer whose readerIndex, writerIndex and capacity are
         // 0, 0 and 8 respectively.
         ChannelBuffer buf = ChannelBuffers.buffer(8);
        
         // IndexOutOfBoundsException is thrown because the specified
         // readerIndex (2) cannot be greater than the current writerIndex (0).
         buf.readerIndex(2);
         buf.writerIndex(4);
         
        The following code will also fail:
         // Create a buffer whose readerIndex, writerIndex and capacity are
         // 0, 8 and 8 respectively.
         ChannelBuffer buf = ChannelBuffers.wrappedBuffer(new byte[8]);
        
         // readerIndex becomes 8.
         buf.readLong();
        
         // IndexOutOfBoundsException is thrown because the specified
         // writerIndex (4) cannot be less than the current readerIndex (8).
         buf.writerIndex(4);
         buf.readerIndex(2);
         
        By contrast, ActiveMQBuffer.setIndex(int, int) guarantees that it never throws an IndexOutOfBoundsException as long as the specified indexes meet basic constraints, regardless what the current index values of the buffer are:
         // No matter what the current state of the buffer is, the following
         // call always succeeds as long as the capacity of the buffer is not
         // less than 4.
         buf.setIndex(2, 4);
         
        Specified by:
        setIndex in interface ActiveMQBuffer
        Overrides:
        setIndex in class ChannelBufferWrapper
        Parameters:
        readerIndex - The reader's index
        writerIndex - The writer's index
      • setByte

        public void setByte​(int index,
                            byte value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setByte in interface ActiveMQBuffer
        Overrides:
        setByte in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified byte
      • setBytes

        public void setBytes​(int index,
                             byte[] src,
                             int srcIndex,
                             int length)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source array's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface ActiveMQBuffer
        Overrides:
        setBytes in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        src - The source buffer
        srcIndex - The source buffer index
        length - The number of bytes to transfer
      • setBytes

        public void setBytes​(int index,
                             byte[] src)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source array's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface ActiveMQBuffer
        Overrides:
        setBytes in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        src - The source buffer
      • setBytes

        public void setBytes​(int index,
                             ByteBuffer src)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the source buffer's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setBytes in interface ActiveMQBuffer
        Overrides:
        setBytes in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        src - The source buffer
      • setBytes

        public void setBytes​(int index,
                             ActiveMQBuffer src,
                             int srcIndex,
                             int length)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source buffer's data to this buffer starting at the specified absolute index. This method does not modify readerIndex or writerIndex of both the source (i.e. this) and the destination.
        Specified by:
        setBytes in interface ActiveMQBuffer
        Overrides:
        setBytes in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        src - The source bufferIndex the first index of the source
        srcIndex - The source buffer index
        length - The number of bytes to transfer
      • setChar

        public void setChar​(int index,
                            char value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified char at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setChar in interface ActiveMQBuffer
        Overrides:
        setChar in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified char
      • setDouble

        public void setDouble​(int index,
                              double value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified double at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setDouble in interface ActiveMQBuffer
        Overrides:
        setDouble in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified double
      • setFloat

        public void setFloat​(int index,
                             float value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified float at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setFloat in interface ActiveMQBuffer
        Overrides:
        setFloat in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified float
      • setInt

        public void setInt​(int index,
                           int value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setInt in interface ActiveMQBuffer
        Overrides:
        setInt in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified 32-bit integer
      • setLong

        public void setLong​(int index,
                            long value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 64-bit long integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setLong in interface ActiveMQBuffer
        Overrides:
        setLong in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified 64-bit long integer
      • setShort

        public void setShort​(int index,
                             short value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 16-bit short integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
        Specified by:
        setShort in interface ActiveMQBuffer
        Overrides:
        setShort in class ChannelBufferWrapper
        Parameters:
        index - Index into the buffer
        value - The specified 16-bit short integer
      • writeByte

        public void writeByte​(byte value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified byte at the current writerIndex and increases the writerIndex by 1 in this buffer.
        Specified by:
        writeByte in interface ActiveMQBuffer
        Overrides:
        writeByte in class ChannelBufferWrapper
        Parameters:
        value - The specified byte
      • writeBytes

        public void writeBytes​(byte[] src,
                               int srcIndex,
                               int length)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
        Specified by:
        writeBytes in interface ActiveMQBuffer
        Overrides:
        writeBytes in class ChannelBufferWrapper
        Parameters:
        src - The source buffer
        srcIndex - the first index of the source
        length - the number of bytes to transfer
      • writeBytes

        public void writeBytes​(byte[] src)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source array's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= src.length).
        Specified by:
        writeBytes in interface ActiveMQBuffer
        Overrides:
        writeBytes in class ChannelBufferWrapper
        Parameters:
        src - The source buffer
      • writeBytes

        public void writeBytes​(ByteBuffer src)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
        Specified by:
        writeBytes in interface ActiveMQBuffer
        Overrides:
        writeBytes in class ChannelBufferWrapper
        Parameters:
        src - The source buffer
      • writeBytes

        public void writeBytes​(io.netty.buffer.ByteBuf src,
                               int srcIndex,
                               int length)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source buffer's data to this buffer starting at the current writerIndex until the source buffer's position reaches its limit, and increases the writerIndex by the number of the transferred bytes.
        Specified by:
        writeBytes in interface ActiveMQBuffer
        Overrides:
        writeBytes in class ChannelBufferWrapper
        Parameters:
        src - The source buffer
      • writeBytes

        public void writeBytes​(ActiveMQBuffer src,
                               int srcIndex,
                               int length)
        Description copied from interface: ActiveMQBuffer
        Transfers the specified source buffer's data to this buffer starting at the current writerIndex and increases the writerIndex by the number of the transferred bytes (= length).
        Specified by:
        writeBytes in interface ActiveMQBuffer
        Overrides:
        writeBytes in class ChannelBufferWrapper
        Parameters:
        src - The source buffer
        srcIndex - the first index of the source
        length - the number of bytes to transfer
      • writeChar

        public void writeChar​(char chr)
        Description copied from interface: ActiveMQBuffer
        Sets the specified char at the current writerIndex and increases the writerIndex by 2 in this buffer.
        Specified by:
        writeChar in interface ActiveMQBuffer
        Overrides:
        writeChar in class ChannelBufferWrapper
        Parameters:
        chr - The specified char
      • writeDouble

        public void writeDouble​(double value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified double at the current writerIndex and increases the writerIndex by 8 in this buffer.
        Specified by:
        writeDouble in interface ActiveMQBuffer
        Overrides:
        writeDouble in class ChannelBufferWrapper
        Parameters:
        value - The specified double
      • writeFloat

        public void writeFloat​(float value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified float at the current writerIndex and increases the writerIndex by 4 in this buffer.
        Specified by:
        writeFloat in interface ActiveMQBuffer
        Overrides:
        writeFloat in class ChannelBufferWrapper
        Parameters:
        value - The specified float
      • writeInt

        public void writeInt​(int value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
        Specified by:
        writeInt in interface ActiveMQBuffer
        Overrides:
        writeInt in class ChannelBufferWrapper
        Parameters:
        value - The specified 32-bit integer
      • writeNullableInt

        public void writeNullableInt​(Integer value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified (potentially null) 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
        Specified by:
        writeNullableInt in interface ActiveMQBuffer
        Overrides:
        writeNullableInt in class ChannelBufferWrapper
        Parameters:
        value - The specified (potentially null) 32-bit integer
      • writeLong

        public void writeLong​(long value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
        Specified by:
        writeLong in interface ActiveMQBuffer
        Overrides:
        writeLong in class ChannelBufferWrapper
        Parameters:
        value - The specified 64-bit long integer
      • writeNullableLong

        public void writeNullableLong​(Long value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified (potentially null) 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
        Specified by:
        writeNullableLong in interface ActiveMQBuffer
        Overrides:
        writeNullableLong in class ChannelBufferWrapper
        Parameters:
        value - The specified (potentially null) 64-bit long integer
      • writeShort

        public void writeShort​(short value)
        Description copied from interface: ActiveMQBuffer
        Sets the specified 16-bit short integer at the current writerIndex and increases the writerIndex by 2 in this buffer.
        Specified by:
        writeShort in interface ActiveMQBuffer
        Overrides:
        writeShort in class ChannelBufferWrapper
        Parameters:
        value - The specified 16-bit short integer