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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static BufferedLineReaderfromString(String s) Returns aBufferedLineReaderthat gets its input from a String.intpeek()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, skipMethods inherited from class java.io.BufferedReader
lines, markSupported, readyMethods inherited from class java.io.Reader
nullReader, read, read, transferToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface htsjdk.samtools.util.LineReader
getLineNumber
-
Constructor Details
-
BufferedLineReader
-
BufferedLineReader
-
-
Method Details
-
fromString
Returns aBufferedLineReaderthat 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:
readLinein interfaceLineReader- Overrides:
readLinein classLineNumberReader- Returns:
- the line read, or null if EOF has been reached.
-
peek
public int peek()Non-destructive one-character look-ahead.- Specified by:
peekin interfaceLineReader- Returns:
- If not eof, the next character that would be read. If eof, -1.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLineReader- Overrides:
closein classBufferedReader
-