public class InputstreamLineReader extends AbstractLineReader
java.io.InputStream
reader, with line reading support. Therefore, this wrapper is able to
detect the doubtless new line characters: Carriage Return and/or Line Feed.Constructor and Description |
---|
InputstreamLineReader(java.io.InputStream inputStream,
java.lang.String encoding)
Create an
InputstreamLineReader so that it uses InputStream as its input stream. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the input stream given with the constructor.
|
protected int |
read()
Read a single character.
|
getNewLineStr, readLine
public InputstreamLineReader(java.io.InputStream inputStream, java.lang.String encoding) throws java.io.UnsupportedEncodingException
InputstreamLineReader
so that it uses InputStream
as its input stream.inputStream
- input stream.encoding
- file encoding.java.io.UnsupportedEncodingException
- if file encoding is not supported.public void close() throws java.io.IOException
AbstractLineReader
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class AbstractLineReader
java.io.IOException
- if an I/O error occurs while closing the input stream.protected int read() throws java.io.IOException
AbstractLineReader
read
in class AbstractLineReader
0x00-0xffff
), or -1 if the end of the stream has
been reached.java.io.IOException
- If an I/O error occurs.