public final class NewlineInput extends TextInput
\r\n
, \n
, \r
) will be normalized to
newline characters \n
, and the input encoding will be guessed by
analyzing the first bytes.Constructor and Description |
---|
NewlineInput(InputStream is)
Constructor.
|
NewlineInput(IO in)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
NewlineInput |
encoding(String encoding)
Sets a new encoding.
|
int |
read()
Returns the next character.
|
String |
readLine()
Reads and returns a single line.
|
boolean |
readLine(TokenBuilder tb)
Copies a single line to the specified token builder.
|
close, io, length, mark, markSupported, readBytes, readString, reset, size
available, read, read, skip
public NewlineInput(InputStream is) throws IOException
is
- input streamIOException
- I/O exceptionpublic NewlineInput(IO in) throws IOException
in
- inputIOException
- I/O exceptionpublic NewlineInput encoding(String encoding) throws IOException
TextInput
encoding
in class TextInput
encoding
- encodingIOException
- I/O Exceptionpublic int read() throws IOException
TextInput
read
in class TextInput
IOException
- I/O exceptionpublic String readLine() throws IOException
null
IOException
- I/O exceptionpublic boolean readLine(TokenBuilder tb) throws IOException
tb
- token builder to be filled.true
if more input was foundIOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.