Package org.ec4j.core

Interface Resource.RandomReader

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
Resource.Resources.StringRandomReader
Enclosing interface:
Resource

public static interface Resource.RandomReader extends Closeable
A readed allowing to access a character on any offset in the underlying resource.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
     
    char
    read(long offset)
     

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • getLength

      long getLength()
      Returns:
      the number of characters
    • read

      char read(long offset) throws IndexOutOfBoundsException
      Parameters:
      offset - the index from which the character should be read
      Returns:
      the character at the given offset
      Throws:
      IndexOutOfBoundsException - if the offset it less than 0 or greater than getLength()