Interface ByteArray.Cursor

  • All Superinterfaces:
    IoRelativeReader, IoRelativeWriter
    Enclosing interface:
    ByteArray

    public static interface ByteArray.Cursor
    extends IoRelativeReader, IoRelativeWriter
    Provides relocatable, relative access to the underlying array. Multiple cursors may be used simultaneously, and cursors will stay consistent with the underlying array, even across modifications. Should this be Cloneable to allow cheap mark/position emulation?
    • Method Detail

      • getIndex

        int getIndex()
        Returns:
        the current index of the cursor.
      • setIndex

        void setIndex​(int index)
        Sets the current index of the cursor. No bounds checking will occur until an access occurs.
        Parameters:
        index - The current index to set
      • get

        byte get()
        Specified by:
        get in interface IoRelativeReader
        Returns:
        the byte at the current position and advances the reader.
      • get

        void get​(IoBuffer bb)
        Gets enough bytes to fill the IoBuffer and advances the reader.
        Specified by:
        get in interface IoRelativeReader
        Parameters:
        bb - The IoBuffer that will contain the read bytes
      • getInt

        int getInt()
        Specified by:
        getInt in interface IoRelativeReader
        Returns:
        an int and advances the reader.