Class CompositeByteArrayRelativeBase

java.lang.Object
org.apache.mina.util.byteaccess.CompositeByteArrayRelativeBase
Direct Known Subclasses:
CompositeByteArrayRelativeReader, CompositeByteArrayRelativeWriter

abstract class CompositeByteArrayRelativeBase extends Object
Provides common functionality between the CompositeByteArrayRelativeReader and CompositeByteArrayRelativeWriter.
  • Field Details

    • cba

      protected final CompositeByteArray cba
      The underlying CompositeByteArray.
    • cursor

      protected final ByteArray.Cursor cursor
      A cursor of the underlying CompositeByteArray. This cursor is never moved directly; its position only changes through calls to relative read or write methods.
  • Constructor Details

    • CompositeByteArrayRelativeBase

      public CompositeByteArrayRelativeBase(CompositeByteArray cba)
      Creates a new instance of CompositeByteArrayRelativeBase.
      Parameters:
      cba - The CompositeByteArray that will be the base for this class
  • Method Details

    • getRemaining

      public final int getRemaining()
      Returns:
      The number of remaining bytes
    • hasRemaining

      public final boolean hasRemaining()
      Returns:
      TRUE if there are some more bytes
    • order

      public ByteOrder order()
      Returns:
      The used byte order (little of big indian)
    • append

      public final void append(ByteArray ba)
      Make a ByteArray available for access at the end of this object.
      Parameters:
      ba - The ByteArray to append
    • free

      public final void free()
      Free all resources associated with this object.
    • getIndex

      public final int getIndex()
      Returns:
      the index that will be used for the next access.
    • last

      public final int last()
      Returns:
      the index after the last byte that can be accessed.
    • cursorPassedFirstComponent

      protected abstract void cursorPassedFirstComponent()
      Called whenever the cursor has passed from the cba's first component. As the first component is no longer used, this provides a good opportunity for subclasses to perform some action on it (such as freeing it).