public abstract class AbstractLineReader
extends java.lang.Object
implements java.io.Closeable
Constructor and Description |
---|
AbstractLineReader() |
Modifier and Type | Method and Description |
---|---|
abstract void |
close()
Close the input stream given with the constructor.
|
java.lang.String |
getNewLineStr()
Return the new line characters combination CR (Carriage Return), LF (Line Feed) or CRLF according to the
InputStream
object given to the current AbstractLineReader object. |
protected abstract int |
read()
Read a single character.
|
java.lang.String |
readLine()
Read a line of text.
|
public abstract void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
- if an I/O error occurs while closing the input stream.public java.lang.String getNewLineStr()
InputStream
object given to the current AbstractLineReader
object. It is based on the number of apparition of each new line
character.readLine()
method to be called enough times in order to calculate the right number of each new
line characters apparition.LineReader
object.protected abstract int read() throws java.io.IOException
0x00-0xffff
), or -1 if the end of the stream has
been reached.java.io.IOException
- If an I/O error occurs.public java.lang.String readLine() throws java.io.IOException
java.io.IOException
- if an I/O error occurs.