public class

LineInputStream

extends FilterInputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ java.io.FilterInputStream
       ↳ com.google.code.com.sun.mail.util.LineInputStream

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class java.io.InputStream
Fields
private static int MAX_INCR
private char[] lineBuffer
[Expand]
Inherited Fields
From class java.io.FilterInputStream
Public Constructors
LineInputStream(InputStream in)
Public Methods
String readLine()
Read a line containing only ASCII characters from the input stream.
[Expand]
Inherited Methods
From class java.io.FilterInputStream
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Fields

private static int MAX_INCR

private char[] lineBuffer

Public Constructors

public LineInputStream (InputStream in)

Parameters
in

Public Methods

public String readLine ()

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()

Throws
IOException