iaik.utils
Class LineInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--java.io.FilterInputStream
|
+--iaik.utils.LineInputStream
- public class LineInputStream
- extends java.io.FilterInputStream
LineInputStream is an InputStream which can be used to read
lines (as with BufferedReader) or to read the original stream
data.
This class may be useful for parsing messages which start with
a couple of RFC822 headers followed by an arbitrary content (e.g. image/gif).
- See Also:
LineOutputStream
|
Field Summary |
protected byte[] |
buffer
|
| Fields inherited from class java.io.FilterInputStream |
in |
|
Constructor Summary |
LineInputStream(java.io.InputStream in)
Creates a new LineInputStream to read data from the specified
input stream. |
|
Method Summary |
byte[] |
getBuffer()
Returns the data in the buffer. |
byte[] |
getLineDelimiter()
Returns the line delimiter of the line just read. |
java.lang.String |
readLine()
Reads a line of text. |
| Methods inherited from class java.io.FilterInputStream |
available,
close,
mark,
markSupported,
read,
read,
read,
reset,
skip |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
buffer
protected byte[] buffer
LineInputStream
public LineInputStream(java.io.InputStream in)
- Creates a new LineInputStream to read data from the specified
input stream.
- Parameters:
in - the underlying input stream
readLine
public java.lang.String readLine()
throws java.io.IOException
- Reads a line of text.
A line is considered to be terminated by any one of a line feed
('\n'), a carriage return ('\r'), or a carriage return followed
immediately by a linefeed.
- Returns:
- a String containing the contents of the line, not including any
line-termination characters, or null if the end of the stream
has been reached
- Throws:
- java.io.IOException - if an I/O error occurs
getLineDelimiter
public byte[] getLineDelimiter()
- Returns the line delimiter of the line just read.
- Returns:
- the line delimiter
getBuffer
public byte[] getBuffer()
throws java.io.IOException
- Returns the data in the buffer.
- Returns:
- the data in the buffer