public final class LineReader
extends java.lang.Object
BufferedReader.readLine() but for all Readable objects, not just instances of
Reader.| Modifier and Type | Field and Description |
|---|---|
private char[] |
buf |
private java.nio.CharBuffer |
cbuf |
private LineBuffer |
lineBuf |
private java.util.Queue<java.lang.String> |
lines |
private java.lang.Readable |
readable |
private java.io.Reader |
reader |
| Constructor and Description |
|---|
LineReader(java.lang.Readable readable)
Creates a new instance that will read lines from the given
Readable object. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
readLine()
Reads a line of text.
|
private final java.lang.Readable readable
@CheckForNull private final java.io.Reader reader
private final java.nio.CharBuffer cbuf
private final char[] buf
private final java.util.Queue<java.lang.String> lines
private final LineBuffer lineBuf
public LineReader(java.lang.Readable readable)
Readable object.@CheckForNull
public java.lang.String readLine()
throws java.io.IOException
'\n'), a carriage return ('\r'), or a carriage return followed immediately by a
linefeed ("\r\n").String containing the contents of the line, not including any
line-termination characters, or null if the end of the stream has been reached.java.io.IOException - if an I/O error occurs