Class BufferedByteCountingLineReader

java.lang.Object
cz.drg.pregrouper.process.fileRead.BufferedByteCountingLineReader
All Implemented Interfaces:
Closeable, AutoCloseable

public class BufferedByteCountingLineReader extends Object implements Closeable
Buffered byte counting line reader with support for counting bytes read and detecting end of file. Important to track read bytes for RAF use.
  • Constructor Details

    • BufferedByteCountingLineReader

      public BufferedByteCountingLineReader()
  • Method Details

    • openFile

      public void openFile(String filename) throws IOException
      Throws:
      IOException
    • setReader

      public void setReader(ByteReader bis)
    • setStartingByte

      public void setStartingByte(long startingByte)
      Set starting byte for RAF. Must be set if the file is not read from the beginning, usually by calling "seek" on the RAF and thus skipping a set number of bytes.
      Parameters:
      startingByte -
    • hasNext

      public boolean hasNext()
    • readLine

      public LineWithIndex readLine() throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException