iaik.utils
Class LineInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.FilterInputStream
              |
              +--iaik.utils.LineInputStream

public class LineInputStream
extends 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).

Version:
File Revision 19
See Also:
LineOutputStream

Field Summary
protected  byte[] buffer
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
LineInputStream(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.
 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
 

Field Detail

buffer

protected byte[] buffer
Constructor Detail

LineInputStream

public LineInputStream(InputStream in)
Creates a new LineInputStream to read data from the specified input stream.
Parameters:
in - the underlying input stream
Method Detail

readLine

public String readLine()
                throws 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:
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 IOException
Returns the data in the buffer.
Returns:
the data in the buffer

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK