Class LargeMessageControllerImpl

java.lang.Object
org.apache.activemq.artemis.core.client.impl.LargeMessageControllerImpl
All Implemented Interfaces:
DataInput, ActiveMQBuffer, LargeMessageController

public class LargeMessageControllerImpl extends Object implements LargeMessageController
This class aggregates several SessionReceiveContinuationMessage as it was being handled by a single buffer. This buffer can be consumed as messages are arriving, and it will hold the packets until they are read using the ChannelBuffer interface, or the setOutputStream or saveStream are called.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout)
     
    LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile)
     
    LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile, int bufferSize)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addPacket(byte[] chunk, int flowControlSize, boolean isContinues)
    TODO: move this to ConsumerContext as large message is a protocol specific thing Add a buff to the List, or save it to the OutputStream if set
    io.netty.buffer.ByteBuf
    Returns the underlying Netty's ByteBuf.
    void
    Cancels this buffer.
    int
    Returns the number of bytes this buffer can contain.
    void
    Sets the readerIndex and writerIndex of this buffer to 0.
    void
    Closes this buffer.
    Returns a copy of this buffer's readable bytes.
    copy(int index, int length)
    Returns a copy of this buffer's sub-region.
    void
    Discards the bytes between the 0th index and readerIndex.
    void
    Discards packets unused by this buffer.
    Returns a buffer which shares the whole region of this buffer.
    byte
    getByte(int index)
    Gets a byte at the specified absolute index in this buffer.
    void
    getBytes(int index, byte[] dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    void
    getBytes(int index, byte[] dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    void
    getBytes(int index, OutputStream out, int length)
     
    void
    getBytes(int index, ByteBuffer dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit.
    int
    getBytes(int index, GatheringByteChannel out, int length)
     
    void
    getBytes(int index, ActiveMQBuffer dst)
    Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination becomes non-writable.
    void
    getBytes(int index, ActiveMQBuffer dst, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    void
    getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the specified absolute index.
    void
    getBytes(long index, byte[] dst)
     
    void
    getBytes(long index, byte[] dst, int dstIndex, int length)
     
    void
    getBytes(long index, OutputStream out, int length)
     
    void
    getBytes(long index, ByteBuffer dst)
     
    char
    getChar(int index)
    Gets a char at the specified absolute index in this buffer.
    double
    getDouble(int index)
    Gets a double at the specified absolute index in this buffer.
    float
    getFloat(int index)
    Gets a float at the specified absolute index in this buffer.
    int
    getInt(int index)
    Gets a 32-bit integer at the specified absolute index in this buffer.
    int
    getInt(long index)
     
    long
    getLong(int index)
    Gets a 64-bit long integer at the specified absolute index in this buffer.
    long
    getLong(long index)
     
    int
    getMedium(int index)
     
    short
    getShort(int index)
    Gets a 16-bit short integer at the specified absolute index in this buffer.
    short
    getShort(long index)
     
    long
    Returns the size of this buffer..
     
    short
    getUnsignedByte(int index)
    Gets an unsigned byte at the specified absolute index in this buffer.
    long
    getUnsignedInt(int index)
    Gets an unsigned 32-bit integer at the specified absolute index in this buffer.
    int
    getUnsignedMedium(long index)
     
    int
    getUnsignedShort(int index)
    Gets an unsigned 16-bit short integer at the specified absolute index in this buffer.
    void
    Marks the current readerIndex in this buffer.
    void
    Marks the current writerIndex in this buffer.
    boolean
    Returns true if and only if (this.writerIndex - this.readerIndex) is greater than 0.
    int
    Returns the number of readable bytes which is equal to (this.writerIndex - this.readerIndex).
    boolean
    Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.
    byte
    Gets a byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
    void
    readBytes(byte[] dst)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= dst.length).
    void
    readBytes(byte[] dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    void
    readBytes(OutputStream out, int length)
     
    void
    Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.
    int
    readBytes(GatheringByteChannel out, int length)
     
    void
    Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination becomes non-writable, and increases the readerIndex by the number of the transferred bytes.
    void
    readBytes(ActiveMQBuffer dst, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    void
    readBytes(ActiveMQBuffer dst, int dstIndex, int length)
    Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
    char
    Gets a char at the current readerIndex and increases the readerIndex by 2 in this buffer.
    double
    Gets a double at the current readerIndex and increases the readerIndex by 8 in this buffer.
    int
    Returns the readerIndex of this buffer..
    void
    readerIndex(int readerIndex)
    Sets the readerIndex of this buffer.
    float
    Gets a float at the current readerIndex and increases the readerIndex by 4 in this buffer.
    void
    readFully(byte[] b)
    from DataInput interface
    void
    readFully(byte[] b, int off, int len)
    from DataInput interface
    int
    Gets a 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
    int
    readInt(int pos)
     
    from DataInput interface
    long
    Gets a 64-bit integer at the current readerIndex and increases the readerIndex by 8 in this buffer.
    int
     
    Gets a (potentially null) boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.
    Gets a (potentially null) 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
    Gets a (potentially null) 64-bit integer at the current readerIndex and increases the readerIndex by 8 in this buffer.
    Gets a SimpleString (potentially null) at the current readerIndex
    Gets a String (potentially null) at the current readerIndex
    short
    Gets a 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
    Gets a non-null SimpleString at the current readerIndex
    readSlice(int length)
    Returns a new slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).
    Gets a non-null String at the current readerIndex
    int
    Gets an unsigned byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
    long
    Gets an unsigned 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
    int
     
    int
    Gets an unsigned 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
    Gets a UTF-8 String at the current readerIndex
    void
    Release any underlying resources held by this buffer
    void
    Repositions the current readerIndex to the marked readerIndex in this buffer.
    void
    Repositions the current writerIndex to the marked writerIndex in this buffer.
    void
    Saves this buffer to the specified output.
    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
    setLocal(boolean local)
     
    void
    setLong(int index, long value)
    Sets the specified 64-bit long integer at the specified absolute index in this buffer.
    void
    Sets the OutputStream of this buffer to the specified output.
    void
    setShort(int index, short value)
    Sets the specified 16-bit short integer at the specified absolute index in this buffer.
    void
    setZero(int index, int length)
     
    int
    skipBytes(int length)
    Increases the current readerIndex by the specified length in this buffer.
    Returns a slice of this buffer's readable bytes.
    slice(int index, int length)
    Returns a slice of this buffer's sub-region.
     
    Converts this buffer's readable bytes into a NIO buffer.
    toByteBuffer(int index, int length)
    Converts this buffer's sub-region into a NIO buffer.
     
    toByteBuffers(int index, int length)
     
    toString(String charsetName)
     
    boolean
    waitCompletion(long timeWait)
    Waits for the completion for the specified waiting time (in milliseconds).
    boolean
    Returns trueif and only if (this.capacity - this.writerIndex) is greater than 0.
    int
    Returns the number of writable bytes which is equal to (this.capacity - this.writerIndex).
    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.
    int
    writeBytes(InputStream in, int length)
     
    void
    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.
    int
     
    void
     
    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 val)
    Sets the specified char at the current writerIndex and increases the writerIndex by 2 in this buffer.
    void
    writeDouble(double val)
    Sets the specified double at the current writerIndex and increases the writerIndex by 8 in this buffer.
    void
    writeFloat(float val)
    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
    writeMedium(int value)
     
    void
    Sets the specified (potentially null) Boolean at the current writerIndex
    void
    Sets the specified (potentially null) 32-bit integer at the current writerIndex and increases the writerIndex by 4 in this buffer.
    void
    Sets the specified (potentially null) 64-bit long integer at the current writerIndex and increases the writerIndex by 8 in this buffer.
    void
    Sets the specified SimpleString (potentially null) at the current writerIndex
    void
    Sets the specified String (potentially null) at the current writerIndex
    int
    Returns the writerIndex of this buffer..
    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
    Sets the specified non-null SimpleString at the current writerIndex
    void
    Sets the specified non-null String at the current writerIndex
    void
    Sets the specified UTF-8 String at the current writerIndex
    void
    writeZero(int length)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LargeMessageControllerImpl

      public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout)
    • LargeMessageControllerImpl

      public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile)
    • LargeMessageControllerImpl

      public LargeMessageControllerImpl(ClientConsumerInternal consumerInternal, long totalSize, long readTimeout, File cachedFile, int bufferSize)
  • Method Details

    • setLocal

      public void setLocal(boolean local)
    • discardUnusedPackets

      public void discardUnusedPackets()
      Description copied from interface: LargeMessageController
      Discards packets unused by this buffer.
      Specified by:
      discardUnusedPackets in interface LargeMessageController
    • addPacket

      public void addPacket(byte[] chunk, int flowControlSize, boolean isContinues)
      TODO: move this to ConsumerContext as large message is a protocol specific thing Add a buff to the List, or save it to the OutputStream if set
      Specified by:
      addPacket in interface LargeMessageController
    • cancel

      public void cancel()
      Description copied from interface: LargeMessageController
      Cancels this buffer.
      Specified by:
      cancel in interface LargeMessageController
    • close

      public void close()
      Description copied from interface: LargeMessageController
      Closes this buffer.
      Specified by:
      close in interface LargeMessageController
    • setOutputStream

      public void setOutputStream(OutputStream output) throws ActiveMQException
      Description copied from interface: LargeMessageController
      Sets the OutputStream of this buffer to the specified output.
      Specified by:
      setOutputStream in interface LargeMessageController
      Throws:
      ActiveMQException
    • saveBuffer

      public void saveBuffer(OutputStream output) throws ActiveMQException
      Description copied from interface: LargeMessageController
      Saves this buffer to the specified output. This is just a blocking version of LargeMessageController.setOutputStream(OutputStream).
      Specified by:
      saveBuffer in interface LargeMessageController
      Throws:
      ActiveMQException
    • waitCompletion

      public boolean waitCompletion(long timeWait) throws ActiveMQException
      Description copied from interface: LargeMessageController
      Waits for the completion for the specified waiting time (in milliseconds).
      Specified by:
      waitCompletion in interface LargeMessageController
      Parameters:
      timeWait - Milliseconds to Wait. 0 means forever
      Throws:
      ActiveMQException
    • take

      Specified by:
      take in interface LargeMessageController
      Throws:
      InterruptedException
    • capacity

      public int capacity()
      Description copied from interface: ActiveMQBuffer
      Returns the number of bytes this buffer can contain.
      Specified by:
      capacity in interface ActiveMQBuffer
      Returns:
      the number of bytes this buffer can contain
    • readByte

      public byte readByte()
      Description copied from interface: ActiveMQBuffer
      Gets a byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
      Specified by:
      readByte in interface ActiveMQBuffer
      Specified by:
      readByte in interface DataInput
      Returns:
      a byte at the current readerIndex
    • getByte

      public byte getByte(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getByte in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      The byte at the specified index
    • getBytes

      public void getBytes(int index, ActiveMQBuffer dst, int dstIndex, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination 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:
      getBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      dst - The destination bufferIndex the first index of the destination
      dstIndex - The index into the destination bufferThe destination buffer
      length - The number of bytes to transfer
    • getBytes

      public void getBytes(int index, byte[] dst, int dstIndex, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the specified absolute index. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      dst - The destination buffer
      dstIndex - The first index of the destination
      length - The number of bytes to transfer
    • getBytes

      public void getBytes(long index, byte[] dst, int dstIndex, int length)
    • getBytes

      public void getBytes(int index, ByteBuffer dst)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination's position reaches its limit. This method does not modify readerIndex or writerIndex of this buffer while the destination's position will be increased.
      Specified by:
      getBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      dst - The destination buffer
    • getBytes

      public void getBytes(long index, ByteBuffer dst)
    • getBytes

      public void getBytes(int index, OutputStream out, int length) throws IOException
      Throws:
      IOException
    • getBytes

      public void getBytes(long index, OutputStream out, int length) throws IOException
      Throws:
      IOException
    • getBytes

      public int getBytes(int index, GatheringByteChannel out, int length) throws IOException
      Throws:
      IOException
    • getInt

      public int getInt(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getInt in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a 32-bit integer at the specified absolute index
    • getInt

      public int getInt(long index)
    • getLong

      public long getLong(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a 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:
      getLong in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a 64-bit long integer at the specified absolute index
    • getLong

      public long getLong(long index)
    • getShort

      public short getShort(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a 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:
      getShort in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a 16-bit short integer at the specified absolute index
    • getShort

      public short getShort(long index)
    • getUnsignedMedium

      public int getUnsignedMedium(long 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
      Parameters:
      index - Index into the buffer
      value - The specified byte
    • 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
      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
    • 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
      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, 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
      Parameters:
      index - Index into the buffer
      src - The source buffer
    • 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
      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
      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
      Parameters:
      index - Index into the buffer
      value - The specified 16-bit short integer
    • toByteBuffer

      public ByteBuffer toByteBuffer(int index, int length)
      Description copied from interface: ActiveMQBuffer
      Converts this buffer's sub-region into a NIO buffer. The returned buffer might or might not share the content with this buffer, while they have separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      toByteBuffer in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      length - The number of bytes
      Returns:
      A converted NIO Buffer
    • release

      public void release()
      Description copied from interface: ActiveMQBuffer
      Release any underlying resources held by this buffer
      Specified by:
      release in interface ActiveMQBuffer
    • readerIndex

      public int readerIndex()
      Description copied from interface: ActiveMQBuffer
      Returns the readerIndex of this buffer..
      Specified by:
      readerIndex in interface ActiveMQBuffer
      Returns:
      the readerIndex of this buffer.
    • readerIndex

      public void readerIndex(int readerIndex)
      Description copied from interface: ActiveMQBuffer
      Sets the readerIndex of this buffer.
      Specified by:
      readerIndex in interface ActiveMQBuffer
      Parameters:
      readerIndex - The reader's index
    • writerIndex

      public int writerIndex()
      Description copied from interface: ActiveMQBuffer
      Returns the writerIndex of this buffer..
      Specified by:
      writerIndex in interface ActiveMQBuffer
      Returns:
      the writerIndex of this buffer.
    • getSize

      public long getSize()
      Description copied from interface: LargeMessageController
      Returns the size of this buffer..
      Specified by:
      getSize in interface LargeMessageController
      Returns:
      the size of this buffer.
    • writerIndex

      public void writerIndex(int writerIndex)
      Description copied from interface: ActiveMQBuffer
      Sets the writerIndex of this buffer.
      Specified by:
      writerIndex in interface ActiveMQBuffer
      Parameters:
      writerIndex - The writer's index
    • 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
      Parameters:
      readerIndex - The reader's index
      writerIndex - The writer's index
    • 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
    • readable

      public boolean readable()
      Description copied from interface: ActiveMQBuffer
      Returns true if and only if (this.writerIndex - this.readerIndex) is greater than 0.
      Specified by:
      readable in interface ActiveMQBuffer
      Returns:
      true if and only if (this.writerIndex - this.readerIndex) is greater than 0
    • writable

      public boolean writable()
      Description copied from interface: ActiveMQBuffer
      Returns trueif and only if (this.capacity - this.writerIndex) is greater than 0.
      Specified by:
      writable in interface ActiveMQBuffer
      Returns:
      trueif and only if (this.capacity - this.writerIndex) is greater than 0
    • readableBytes

      public int readableBytes()
      Description copied from interface: ActiveMQBuffer
      Returns the number of readable bytes which is equal to (this.writerIndex - this.readerIndex).
      Specified by:
      readableBytes in interface ActiveMQBuffer
      Returns:
      the number of readable bytes which is equal to (this.writerIndex - this.readerIndex)
    • writableBytes

      public int writableBytes()
      Description copied from interface: ActiveMQBuffer
      Returns the number of writable bytes which is equal to (this.capacity - this.writerIndex).
      Specified by:
      writableBytes in interface ActiveMQBuffer
      Returns:
      the number of writable bytes which is equal to (this.capacity - this.writerIndex)
    • markReaderIndex

      public void markReaderIndex()
      Description copied from interface: ActiveMQBuffer
      Marks the current readerIndex in this buffer. You can reposition the current readerIndex to the marked readerIndex by calling ActiveMQBuffer.resetReaderIndex(). The initial value of the marked readerIndex is 0.
      Specified by:
      markReaderIndex in interface ActiveMQBuffer
    • resetReaderIndex

      public void resetReaderIndex()
      Description copied from interface: ActiveMQBuffer
      Repositions the current readerIndex to the marked readerIndex in this buffer.
      Specified by:
      resetReaderIndex in interface ActiveMQBuffer
    • markWriterIndex

      public void markWriterIndex()
      Description copied from interface: ActiveMQBuffer
      Marks the current writerIndex in this buffer. You can reposition the current writerIndex to the marked writerIndex by calling ActiveMQBuffer.resetWriterIndex(). The initial value of the marked writerIndex is 0.
      Specified by:
      markWriterIndex in interface ActiveMQBuffer
    • resetWriterIndex

      public void resetWriterIndex()
      Description copied from interface: ActiveMQBuffer
      Repositions the current writerIndex to the marked writerIndex in this buffer.
      Specified by:
      resetWriterIndex in interface ActiveMQBuffer
    • discardReadBytes

      public void discardReadBytes()
      Description copied from interface: ActiveMQBuffer
      Discards the bytes between the 0th index and readerIndex. It moves the bytes between readerIndex and writerIndex to the 0th index, and sets readerIndex and writerIndex to 0 and oldWriterIndex - oldReaderIndex respectively.

      Please refer to the class documentation for more detailed explanation.

      Specified by:
      discardReadBytes in interface ActiveMQBuffer
    • getUnsignedByte

      public short getUnsignedByte(int index)
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned byte at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getUnsignedByte in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      an unsigned byte at the specified absolute index
    • getUnsignedShort

      public int getUnsignedShort(int index)
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned 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:
      getUnsignedShort in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      an unsigned 16-bit short integer
    • getMedium

      public int getMedium(int index)
    • getUnsignedInt

      public long getUnsignedInt(int index)
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned 32-bit integer at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getUnsignedInt in interface ActiveMQBuffer
      Parameters:
      index - The index into this buffer
      Returns:
      an unsigned 32-bit integer at the specified absolute index
    • getBytes

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

      public void getBytes(long index, byte[] dst)
    • getBytes

      public void getBytes(int index, ActiveMQBuffer dst)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the specified absolute index until the destination becomes non-writable. This method is basically same with ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes while ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
      Specified by:
      getBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      dst - The destination buffer
    • getBytes

      public void getBytes(int index, ActiveMQBuffer dst, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the specified absolute index. This method is basically same with ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes while ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
      Specified by:
      getBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      dst - The destination buffer
      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
      Parameters:
      index - Index into the buffer
      src - The source buffer
    • setBytes

      public void setBytes(int index, ActiveMQBuffer src)
      Description copied from interface: ActiveMQBuffer
      Transfers the specified source buffer's data to this buffer starting at the specified absolute index until the destination becomes unreadable. This method is basically same with ActiveMQBuffer.setBytes(int, ActiveMQBuffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
      Specified by:
      setBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      src - The source buffer
    • setBytes

      public void setBytes(int index, ActiveMQBuffer src, 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 is basically same with ActiveMQBuffer.setBytes(int, ActiveMQBuffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes while ActiveMQBuffer.getBytes(int, ActiveMQBuffer, int, int) does not. This method does not modify readerIndex or writerIndex of the source buffer (i.e. this).
      Specified by:
      setBytes in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      src - The source buffer
      length - the number of bytes to transfer
    • setZero

      public void setZero(int index, int length)
    • readUnsignedByte

      public int readUnsignedByte()
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned byte at the current readerIndex and increases the readerIndex by 1 in this buffer.
      Specified by:
      readUnsignedByte in interface ActiveMQBuffer
      Specified by:
      readUnsignedByte in interface DataInput
      Returns:
      an unsigned byte at the current readerIndex
    • readShort

      public short readShort()
      Description copied from interface: ActiveMQBuffer
      Gets a 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
      Specified by:
      readShort in interface ActiveMQBuffer
      Specified by:
      readShort in interface DataInput
      Returns:
      a 16-bit short integer at the current readerIndex
    • readUnsignedShort

      public int readUnsignedShort()
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned 16-bit short integer at the current readerIndex and increases the readerIndex by 2 in this buffer.
      Specified by:
      readUnsignedShort in interface ActiveMQBuffer
      Specified by:
      readUnsignedShort in interface DataInput
      Returns:
      an unsigned 16-bit short integer at the current readerIndex
    • readMedium

      public int readMedium()
    • readUnsignedMedium

      public int readUnsignedMedium()
    • readInt

      public int readInt()
      Description copied from interface: ActiveMQBuffer
      Gets a 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
      Specified by:
      readInt in interface ActiveMQBuffer
      Specified by:
      readInt in interface DataInput
      Returns:
      a 32-bit integer at the current readerIndex
    • readInt

      public int readInt(int pos)
    • readNullableInt

      public Integer readNullableInt()
      Description copied from interface: ActiveMQBuffer
      Gets a (potentially null) 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
      Specified by:
      readNullableInt in interface ActiveMQBuffer
      Returns:
      a (potentially null) 32-bit integer at the current readerIndex
    • readUnsignedInt

      public long readUnsignedInt()
      Description copied from interface: ActiveMQBuffer
      Gets an unsigned 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.
      Specified by:
      readUnsignedInt in interface ActiveMQBuffer
      Returns:
      an unsigned 32-bit integer at the current readerIndex
    • readLong

      public long readLong()
      Description copied from interface: ActiveMQBuffer
      Gets a 64-bit integer at the current readerIndex and increases the readerIndex by 8 in this buffer.
      Specified by:
      readLong in interface ActiveMQBuffer
      Specified by:
      readLong in interface DataInput
      Returns:
      a 64-bit integer at the current readerIndex
    • readNullableLong

      public Long readNullableLong()
      Description copied from interface: ActiveMQBuffer
      Gets a (potentially null) 64-bit integer at the current readerIndex and increases the readerIndex by 8 in this buffer.
      Specified by:
      readNullableLong in interface ActiveMQBuffer
      Returns:
      a (potentially null) 64-bit integer at the current readerIndex
    • readBytes

      public void readBytes(byte[] dst, int dstIndex, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
      dstIndex - The destination bufferIndex
      length - the number of bytes to transfer
    • readBytes

      public void readBytes(byte[] dst)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= dst.length).
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
    • readBytes

      public void readBytes(ActiveMQBuffer dst)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination becomes non-writable, and increases the readerIndex by the number of the transferred bytes. This method is basically same with ActiveMQBuffer.readBytes(ActiveMQBuffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes while ActiveMQBuffer.readBytes(ActiveMQBuffer, int, int) does not.
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
    • readBytes

      public void readBytes(ActiveMQBuffer dst, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length). This method is basically same with ActiveMQBuffer.readBytes(ActiveMQBuffer, int, int), except that this method increases the writerIndex of the destination by the number of the transferred bytes (= length) while ActiveMQBuffer.readBytes(ActiveMQBuffer, int, int) does not.
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
      length - The number of bytes to transfer
    • readBytes

      public void readBytes(ActiveMQBuffer dst, int dstIndex, int length)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex and increases the readerIndex by the number of the transferred bytes (= length).
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
      dstIndex - The destination buffer index
      length - the number of bytes to transfer
    • readBytes

      public void readBytes(ByteBuffer dst)
      Description copied from interface: ActiveMQBuffer
      Transfers this buffer's data to the specified destination starting at the current readerIndex until the destination's position reaches its limit, and increases the readerIndex by the number of the transferred bytes.
      Specified by:
      readBytes in interface ActiveMQBuffer
      Parameters:
      dst - The destination buffer
    • readBytes

      public int readBytes(GatheringByteChannel out, int length) throws IOException
      Throws:
      IOException
    • readBytes

      public void readBytes(OutputStream out, int length) throws IOException
      Throws:
      IOException
    • skipBytes

      public int skipBytes(int length)
      Description copied from interface: ActiveMQBuffer
      Increases the current readerIndex by the specified length in this buffer.
      Specified by:
      skipBytes in interface ActiveMQBuffer
      Specified by:
      skipBytes in interface DataInput
      Parameters:
      length - The number of bytes to skip
    • 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
      Parameters:
      value - The specified byte
    • 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
      Parameters:
      value - The specified 16-bit short integer
    • writeMedium

      public void writeMedium(int value)
    • 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
      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
      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
      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
      Parameters:
      value - The specified (potentially null) 64-bit long integer
    • 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
      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
      Parameters:
      src - The source buffer
    • writeBytes

      public void writeBytes(ActiveMQBuffer src)
    • writeBytes

      public void writeBytes(ActiveMQBuffer src, 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). This method is basically same with ActiveMQBuffer.writeBytes(ActiveMQBuffer, int, int), except that this method increases the readerIndex of the source buffer by the number of the transferred bytes (= length) while ActiveMQBuffer.writeBytes(ActiveMQBuffer, int, int) does not.
      Specified by:
      writeBytes in interface ActiveMQBuffer
      Parameters:
      src - The source buffer
      length - the number of bytes to transfer
    • 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
      Parameters:
      src - The source buffer
    • writeBytes

      public 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.
      Specified by:
      writeBytes in interface ActiveMQBuffer
      Parameters:
      src - The source buffer
      Throws:
      IndexOutOfBoundsException - if src.remaining() is greater than this.writableBytes
    • writeBytes

      public int writeBytes(InputStream in, int length) throws IOException
      Throws:
      IOException
    • writeBytes

      public int writeBytes(ScatteringByteChannel in, int length) throws IOException
      Throws:
      IOException
    • writeZero

      public void writeZero(int length)
    • toByteBuffer

      public ByteBuffer toByteBuffer()
      Description copied from interface: ActiveMQBuffer
      Converts this buffer's readable bytes into a NIO buffer. The returned buffer might or might not share the content with this buffer, while they have separate indexes and marks. This method is identical to buf.toByteBuffer(buf.readerIndex(), buf.readableBytes()). This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      toByteBuffer in interface ActiveMQBuffer
      Returns:
      A converted NIO ByteBuffer
    • toByteBuffers

      public ByteBuffer[] toByteBuffers()
    • toByteBuffers

      public ByteBuffer[] toByteBuffers(int index, int length)
    • toString

      public String toString(String charsetName)
    • getUnderlyingBuffer

      public Object getUnderlyingBuffer()
    • readBoolean

      public boolean readBoolean()
      Description copied from interface: ActiveMQBuffer
      Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.
      Specified by:
      readBoolean in interface ActiveMQBuffer
      Specified by:
      readBoolean in interface DataInput
      Returns:
      a boolean at the current readerIndex
    • readNullableBoolean

      public Boolean readNullableBoolean()
      Description copied from interface: ActiveMQBuffer
      Gets a (potentially null) boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.
      Specified by:
      readNullableBoolean in interface ActiveMQBuffer
      Returns:
      a (potentially null) boolean at the current readerIndex
    • readChar

      public char readChar()
      Description copied from interface: ActiveMQBuffer
      Gets a char at the current readerIndex and increases the readerIndex by 2 in this buffer.
      Specified by:
      readChar in interface ActiveMQBuffer
      Specified by:
      readChar in interface DataInput
      Returns:
      a char at the current readerIndex
    • getChar

      public char getChar(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a char at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getChar in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a char at the specified absolute index
    • getDouble

      public double getDouble(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a double at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getDouble in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a double at the specified absolute index
    • getFloat

      public float getFloat(int index)
      Description copied from interface: ActiveMQBuffer
      Gets a float at the specified absolute index in this buffer. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      getFloat in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      Returns:
      a float at the specified absolute index
    • readDouble

      public double readDouble()
      Description copied from interface: ActiveMQBuffer
      Gets a double at the current readerIndex and increases the readerIndex by 8 in this buffer.
      Specified by:
      readDouble in interface ActiveMQBuffer
      Specified by:
      readDouble in interface DataInput
      Returns:
      a double at the current readerIndex
    • readFloat

      public float readFloat()
      Description copied from interface: ActiveMQBuffer
      Gets a float at the current readerIndex and increases the readerIndex by 4 in this buffer.
      Specified by:
      readFloat in interface ActiveMQBuffer
      Specified by:
      readFloat in interface DataInput
      Returns:
      a float at the current readerIndex
    • readNullableSimpleString

      public SimpleString readNullableSimpleString()
      Description copied from interface: ActiveMQBuffer
      Gets a SimpleString (potentially null) at the current readerIndex
      Specified by:
      readNullableSimpleString in interface ActiveMQBuffer
      Returns:
      a SimpleString (potentially null) at the current readerIndex
    • readNullableString

      public String readNullableString()
      Description copied from interface: ActiveMQBuffer
      Gets a String (potentially null) at the current readerIndex
      Specified by:
      readNullableString in interface ActiveMQBuffer
      Returns:
      a String (potentially null) at the current readerIndex
    • readSimpleString

      public SimpleString readSimpleString()
      Description copied from interface: ActiveMQBuffer
      Gets a non-null SimpleString at the current readerIndex
      Specified by:
      readSimpleString in interface ActiveMQBuffer
      Returns:
      a non-null SimpleString at the current readerIndex
    • readString

      public String readString()
      Description copied from interface: ActiveMQBuffer
      Gets a non-null String at the current readerIndex
      Specified by:
      readString in interface ActiveMQBuffer
      Returns:
      a non-null String at the current readerIndex
    • readUTF

      public String readUTF()
      Description copied from interface: ActiveMQBuffer
      Gets a UTF-8 String at the current readerIndex
      Specified by:
      readUTF in interface ActiveMQBuffer
      Specified by:
      readUTF in interface DataInput
      Returns:
      a UTF-8 String at the current readerIndex
    • writeBoolean

      public void writeBoolean(boolean val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified boolean at the current writerIndex
      Specified by:
      writeBoolean in interface ActiveMQBuffer
      Parameters:
      val - The specified boolean
    • writeNullableBoolean

      public void writeNullableBoolean(Boolean val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified (potentially null) Boolean at the current writerIndex
      Specified by:
      writeNullableBoolean in interface ActiveMQBuffer
      Parameters:
      val - The specified boolean
    • writeChar

      public void writeChar(char val)
      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
      Parameters:
      val - The specified char
    • writeDouble

      public void writeDouble(double val)
      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
      Parameters:
      val - The specified double
    • writeFloat

      public void writeFloat(float val)
      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
      Parameters:
      val - The specified float
    • writeNullableSimpleString

      public void writeNullableSimpleString(SimpleString val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified SimpleString (potentially null) at the current writerIndex
      Specified by:
      writeNullableSimpleString in interface ActiveMQBuffer
      Parameters:
      val - The specified SimpleString
    • writeNullableString

      public void writeNullableString(String val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified String (potentially null) at the current writerIndex
      Specified by:
      writeNullableString in interface ActiveMQBuffer
      Parameters:
      val - The specified String
    • writeSimpleString

      public void writeSimpleString(SimpleString val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified non-null SimpleString at the current writerIndex
      Specified by:
      writeSimpleString in interface ActiveMQBuffer
      Parameters:
      val - The specified non-null SimpleString
    • writeString

      public void writeString(String val)
      Description copied from interface: ActiveMQBuffer
      Sets the specified non-null String at the current writerIndex
      Specified by:
      writeString in interface ActiveMQBuffer
      Parameters:
      val - The specified non-null String
    • writeUTF

      public void writeUTF(String utf)
      Description copied from interface: ActiveMQBuffer
      Sets the specified UTF-8 String at the current writerIndex
      Specified by:
      writeUTF in interface ActiveMQBuffer
      Parameters:
      utf - The specified UTF-8 String
    • copy

      public ActiveMQBuffer copy()
      Description copied from interface: ActiveMQBuffer
      Returns a copy of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer does not affect each other at all. This method is identical to buf.copy(buf.readerIndex(), buf.readableBytes()). This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      copy in interface ActiveMQBuffer
      Returns:
      a copy of this buffer's readable bytes
    • slice

      public ActiveMQBuffer slice(int index, int length)
      Description copied from interface: ActiveMQBuffer
      Returns a slice of this buffer's sub-region. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      slice in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      length - The number of bytes
      Returns:
      a slice of this buffer's sub-region
    • readFully

      public void readFully(byte[] b) throws IOException
      from DataInput interface
      Specified by:
      readFully in interface DataInput
      Throws:
      IOException
    • readFully

      public void readFully(byte[] b, int off, int len) throws IOException
      from DataInput interface
      Specified by:
      readFully in interface DataInput
      Throws:
      IOException
    • readLine

      public String readLine() throws IOException
      from DataInput interface
      Specified by:
      readLine in interface DataInput
      Throws:
      IOException
    • byteBuf

      public io.netty.buffer.ByteBuf byteBuf()
      Description copied from interface: ActiveMQBuffer
      Returns the underlying Netty's ByteBuf.
      Specified by:
      byteBuf in interface ActiveMQBuffer
      Returns:
      the underlying Netty's ByteBuf
    • copy

      public ActiveMQBuffer copy(int index, int length)
      Description copied from interface: ActiveMQBuffer
      Returns a copy of this buffer's sub-region. Modifying the content of the returned buffer or this buffer does not affect each other at all. This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      copy in interface ActiveMQBuffer
      Parameters:
      index - Index into the buffer
      length - The number of bytes to copy
      Returns:
      a copy of this buffer's readable bytes
    • duplicate

      public ActiveMQBuffer duplicate()
      Description copied from interface: ActiveMQBuffer
      Returns a buffer which shares the whole region of this buffer. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(0, buf.capacity()). This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      duplicate in interface ActiveMQBuffer
      Returns:
      a buffer which shares the whole region of this buffer
    • readSlice

      public ActiveMQBuffer readSlice(int length)
      Description copied from interface: ActiveMQBuffer
      Returns a new slice of this buffer's sub-region starting at the current readerIndex and increases the readerIndex by the size of the new slice (= length).
      Specified by:
      readSlice in interface ActiveMQBuffer
      Parameters:
      length - the size of the new slice
      Returns:
      the newly created slice
    • 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
      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
      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
      Parameters:
      index - Index into the buffer
      value - The specified float
    • slice

      public ActiveMQBuffer slice()
      Description copied from interface: ActiveMQBuffer
      Returns a slice of this buffer's readable bytes. Modifying the content of the returned buffer or this buffer affects each other's content while they maintain separate indexes and marks. This method is identical to buf.slice(buf.readerIndex(), buf.readableBytes()). This method does not modify readerIndex or writerIndex of this buffer.
      Specified by:
      slice in interface ActiveMQBuffer
      Returns:
      a slice of this buffer's readable bytes
    • 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
      Parameters:
      src - The source buffer
      srcIndex - the first index of the source
      length - the number of bytes to transfer