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
public class BufferedLineReader extends LineNumberReader implements LineReader
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.
-
-
Constructor Summary
Constructors Constructor Description BufferedLineReader(InputStream is)BufferedLineReader(InputStream is, int bufferSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static BufferedLineReaderfromString(String s)Returns aBufferedLineReaderthat gets its input from a String.intpeek()Non-destructive one-character look-ahead.StringreadLine()Read a line and remove the line terminator-
Methods 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 Detail
-
BufferedLineReader
public BufferedLineReader(InputStream is)
-
BufferedLineReader
public BufferedLineReader(InputStream is, int bufferSize)
-
-
Method Detail
-
fromString
public static BufferedLineReader fromString(String s)
Returns aBufferedLineReaderthat gets its input from a String. No charset conversion is necessary because the String is in unicode.
-
readLine
public String 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
-
-