Interface IoAbsoluteReader

All Known Subinterfaces:
ByteArray
All Known Implementing Classes:
AbstractByteArray, BufferByteArray, ByteArrayPool.DirectBufferByteArray, CompositeByteArray

public interface IoAbsoluteReader
Provides absolute read access to a sequence of bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    byte
    get(int index)
     
    void
    get(int index, IoBuffer bb)
    Gets enough bytes to fill the IoBuffer from the given index.
    char
    getChar(int index)
     
    double
    getDouble(int index)
     
    float
    getFloat(int index)
     
    int
    getInt(int index)
     
    long
    getLong(int index)
     
    short
    getShort(int index)
     
    int
     
    int
     
     
    slice(int index, int length)
    Creates an array with a view of part of this array.
  • Method Details

    • first

      int first()
      Returns:
      the index of the first byte that can be accessed.
    • last

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

      int length()
      Returns:
      the total number of bytes that can be accessed.
    • slice

      ByteArray slice(int index, int length)
      Creates an array with a view of part of this array.
      Parameters:
      index - The starting position
      length - The number of bytes to copy
      Returns:
      The ByteArray that is a view on the original array
    • order

      ByteOrder order()
      Returns:
      the order of the bytes.
    • get

      byte get(int index)
      Parameters:
      index - The starting position
      Returns:
      a byte from the given index.
    • get

      void get(int index, IoBuffer bb)
      Gets enough bytes to fill the IoBuffer from the given index.
      Parameters:
      index - The starting position
      bb - The IoBuffer that will be filled with the bytes
    • getShort

      short getShort(int index)
      Parameters:
      index - The starting position
      Returns:
      a short from the given index.
    • getInt

      int getInt(int index)
      Parameters:
      index - The starting position
      Returns:
      an int from the given index.
    • getLong

      long getLong(int index)
      Parameters:
      index - The starting position
      Returns:
      a long from the given index.
    • getFloat

      float getFloat(int index)
      Parameters:
      index - The starting position
      Returns:
      a float from the given index.
    • getDouble

      double getDouble(int index)
      Parameters:
      index - The starting position
      Returns:
      a double from the given index.
    • getChar

      char getChar(int index)
      Parameters:
      index - The starting position
      Returns:
      a char from the given index.