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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte readByte()
      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 readChar()
      Reads a char from the current position.
      double readDouble()
      Reads a double from the current position.
      float readFloat()
      Reads a float from the current position.
      int readInt()
      Reads an int from the current position.
      long readLong()
      Reads a long from the current position.
      short readShort()
      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 Detail

      • readByte

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

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

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

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

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

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

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

        void readBytes​(byte[] b,
                       int off,
                       int len)
                throws java.io.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:
        java.io.IOException
      • seek

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

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