Package htsjdk.samtools.util
Class BufferedLineReader
java.lang.Object
java.io.Reader
java.io.BufferedReader
java.io.LineNumberReader
htsjdk.samtools.util.BufferedLineReader
- All Implemented Interfaces:
LineReader
,Closeable
,AutoCloseable
,Readable
- Direct Known Subclasses:
StringLineReader
Implementation of LineReader that is a thin wrapper around BufferedReader. On Linux, this is faster
than AsciiLineReaderImpl. If you use AsciiLineReader rather than this class, it will detect the OS
and delegate to the preferred implementation.
-
Field Summary
Fields inherited from interface htsjdk.samtools.util.LineReader
EOF_VALUE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static BufferedLineReader
fromString
(String s) Returns aBufferedLineReader
that gets its input from a String.int
peek()
Non-destructive one-character look-ahead.readLine()
Read a line and remove the line terminatorMethods inherited from class java.io.LineNumberReader
getLineNumber, mark, read, read, reset, setLineNumber, skip
Methods inherited from class java.io.BufferedReader
lines, markSupported, ready
Methods inherited from class java.io.Reader
nullReader, read, read, transferTo
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.samtools.util.LineReader
getLineNumber
-
Constructor Details
-
BufferedLineReader
-
BufferedLineReader
-
-
Method Details
-
fromString
Returns aBufferedLineReader
that gets its input from a String. No charset conversion is necessary because the String is in unicode. -
readLine
Read a line and remove the line terminator- Specified by:
readLine
in interfaceLineReader
- Overrides:
readLine
in classLineNumberReader
- Returns:
- the line read, or null if EOF has been reached.
-
peek
public int peek()Non-destructive one-character look-ahead.- Specified by:
peek
in interfaceLineReader
- Returns:
- If not eof, the next character that would be read. If eof, -1.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceLineReader
- Overrides:
close
in classBufferedReader
-