Class BufferedByteCountingLineReader
java.lang.Object
cz.drg.pregrouper.process.fileRead.BufferedByteCountingLineReader
- All Implemented Interfaces:
Closeable,AutoCloseable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanhasNext()voidreadLine()voidsetReader(ByteReader bis) voidsetStartingByte(long startingByte) Set starting byte for RAF.
-
Constructor Details
-
BufferedByteCountingLineReader
public BufferedByteCountingLineReader()
-
-
Method Details
-
openFile
- Throws:
IOException
-
setReader
-
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
- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-