Top Description Fields Constructors Methods
com.sun.mail.util

public Class LineInputStream

extends FilterInputStream
Class Inheritance
Imports
java.io.*, java.nio.charset.StandardCharsets

This class is to support reading CRLF terminated lines that contain only US-ASCII characters from an input stream. Provides functionality that is similar to the deprecated DataInputStream.readLine(). Expected use is to read lines as String objects from a RFC822 stream. It is implemented as a FilterInputStream, so one can just wrap this class around any input stream and read bytes from this filter.
Authors
John Mani, Bill Shannon

Field Summary

Modifier and TypeField and Description
private boolean
private byte[]
private static int
Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public
public
LineInputStream(InputStream
the InputStream
in
,
boolean
allow UTF-8 characters?
allowutf8
)

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the line
readLine
()

Read a line containing only ASCII characters from the input stream.

Inherited from java.io.FilterInputStream:
availableclosemarkmarkSupportedreadreadreadresetskip

Field Detail

allowutf8back to summary
private boolean allowutf8
lineBufferback to summary
private byte[] lineBuffer
MAX_INCRback to summary
private static int MAX_INCR

Constructor Detail

LineInputStreamback to summary
public LineInputStream(InputStream in)
LineInputStreamback to summary
public LineInputStream(InputStream in, boolean allowutf8)
Parameters
in:InputStream

the InputStream

allowutf8:boolean

allow UTF-8 characters?

Since
JavaMail 1.6

Method Detail

readLineback to summary
public String readLine() throws IOException

Read a line containing only ASCII characters from the input stream. A line is terminated by a CR or NL or CR-NL sequence. A common error is a CR-CR-NL sequence, which will also terminate a line. The line terminator is not returned as part of the returned String. Returns null if no data is available.

This class is similar to the deprecated DataInputStream.readLine()

Returns:String

the line

Annotations
@SuppressWarnings:deprecation
Exceptions
IOException:
for I/O errors