Interface ByteStoreAccess

All Known Implementing Classes:
NioByteStoreAccess

public interface ByteStoreAccess
Interface for random access reading for data that has been written into a byte store. This resembles DataInput, but omits some of the methods there, and adds seek(long) and skip(int) methods. A pointer is maintained, and is advanced appropriately by the various read methods.
Since:
20 Aug 2010
Author:
Mark Taylor
  • Method Summary

    Modifier and Type
    Method
    Description
    byte
    Reads a byte from the current position.
    void
    readBytes(byte[] b, int off, int len)
    Reads bytes into a buffer from the current position.
    char
    Reads a char from the current position.
    double
    Reads a double from the current position.
    float
    Reads a float from the current position.
    int
    Reads an int from the current position.
    long
    Reads a long from the current position.
    short
    Reads a short from the current position.
    void
    seek(long pos)
    Sets the position to the given value.
    void
    skip(int len)
    Advances the position by a given number of bytes.
  • Method Details

    • readByte

      byte readByte() throws IOException
      Reads a byte from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readShort

      short readShort() throws IOException
      Reads a short from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readChar

      char readChar() throws IOException
      Reads a char from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readInt

      int readInt() throws IOException
      Reads an int from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readLong

      long readLong() throws IOException
      Reads a long from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readFloat

      float readFloat() throws IOException
      Reads a float from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readDouble

      double readDouble() throws IOException
      Reads a double from the current position.
      Returns:
      read value
      Throws:
      IOException
    • readBytes

      void readBytes(byte[] b, int off, int len) throws IOException
      Reads bytes into a buffer from the current position.
      Parameters:
      b - buffer to receive bytes
      off - offset into b for first byte
      len - number of bytes to read
      Throws:
      IOException
    • seek

      void seek(long pos) throws IOException
      Sets the position to the given value.
      Parameters:
      pos - new position
      Throws:
      IOException
    • skip

      void skip(int len) throws IOException
      Advances the position by a given number of bytes.
      Parameters:
      len - number of bytes
      Throws:
      IOException