Package ghidra.program.model.pcode

# Class LinkedByteBuffer.Position

java.lang.Object
ghidra.program.model.pcode.LinkedByteBuffer.Position

Enclosing class:
  `LinkedByteBuffer`

public static class LinkedByteBuffer.Position extends Object
An iterator into the byte buffer

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `byte[]`
  `array`
  `LinkedByteBuffer`
  `buffer`
  `int`
  `current`
  `LinkedByteBuffer.ArrayIter`
  `seqIter`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Position()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `advancePosition(int skip)`
  Advance this Position by the specified number of bytes
  `void`
  `copy(LinkedByteBuffer.Position pos)`
  Set this to be a copy of another Position
  `final byte`
  `getByte()`
  Return the byte at the current Position.
  `final byte`
  `getBytePlus1()`
  Lookahead exactly one byte, without advancing this Position
  `final byte`
  `getNextByte()`
  Advance this Position by exactly one byte and return the next byte.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### buffer

    public LinkedByteBuffer buffer

  - ### seqIter

    public LinkedByteBuffer.ArrayIter seqIter

  - ### array

    public byte[] array

  - ### current

    public int current

- ## Constructor Details

  - ### Position

    public Position()

- ## Method Details

  - ### copy

    public void copy(LinkedByteBuffer.Position pos)
    Set this to be a copy of another Position
    Parameters:
      `pos` - is the Position being copied

  - ### getByte

    public final byte getByte()
    Return the byte at the current Position. Do not advance the Position.
    Returns:
      the byte at this Position

  - ### getBytePlus1

    public final byte getBytePlus1() throws DecoderException
    Lookahead exactly one byte, without advancing this Position
    Returns:
      the byte after the one at this Position
    Throws:
      `DecoderException` - if the end of stream is reached

  - ### getNextByte

    public final byte getNextByte() throws DecoderException
    Advance this Position by exactly one byte and return the next byte.
    Returns:
      the next byte
    Throws:
      `DecoderException` - if the end of stream is reached

  - ### advancePosition

    public final void advancePosition(int skip) throws DecoderException
    Advance this Position by the specified number of bytes
    Parameters:
      `skip` - is the specified number of bytes to advance
    Throws:
      `DecoderException` - if the end of stream is reached