public class LineInputStream extends FilterInputStream
DataInputStream.readLine()
. Expected use is to read
lines as String objects from an IMAP/SMTP/etc. stream.
This class also supports UTF-8 data by calling the appropriate
constructor. Or, if the System property mail.mime.allowutf8
is set to true, an attempt will be made to interpret the data as UTF-8,
falling back to treating it as an 8-bit charset if that fails.
LineInputStream is implemented as a FilterInputStream, so one can just wrap it around any input stream and read bytes from this filter.
in
Constructor and Description |
---|
LineInputStream(InputStream in) |
LineInputStream(InputStream in,
boolean allowutf8) |
Modifier and Type | Method and Description |
---|---|
String |
readLine()
Read a line containing only ASCII characters from the input
stream.
|
available, close, mark, markSupported, read, read, read, reset, skip
public LineInputStream(InputStream in)
public LineInputStream(InputStream in, boolean allowutf8)
in
- the InputStreamallowutf8
- allow UTF-8 characters?public String readLine() throws IOException
This class is similar to the deprecated
DataInputStream.readLine()
IOException
- for I/O errorsCopyright © 2021 JBoss by Red Hat. All rights reserved.