gnu.inet.util
Class CRLFInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by gnu.inet.util.CRLFInputStream
All Implemented Interfaces:
java.io.Closeable

public class CRLFInputStream
extends java.io.InputStream

An input stream that filters out CR/LF pairs into LFs.

Author:
Chris Burdess

Field Summary
static int CR
          The CR octet.
protected  java.io.InputStream in
          The underlying input stream.
static int LF
          The LF octet.
 
Constructor Summary
CRLFInputStream(java.io.InputStream in)
          Constructs a CR/LF input stream connected to the specified input stream.
 
Method Summary
 int read()
          Reads the next byte of data from this input stream.
 int read(byte[] b)
          Reads up to b.length bytes of data from this input stream into an array of bytes.
 int read(byte[] b, int off, int len)
          Reads up to len bytes of data from this input stream into an array of bytes, starting at the specified offset.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CR

public static final int CR
The CR octet.

See Also:
Constant Field Values

LF

public static final int LF
The LF octet.

See Also:
Constant Field Values

in

protected java.io.InputStream in
The underlying input stream.

Constructor Detail

CRLFInputStream

public CRLFInputStream(java.io.InputStream in)
Constructs a CR/LF input stream connected to the specified input stream.

Method Detail

read

public int read()
         throws java.io.IOException
Reads the next byte of data from this input stream. Returns -1 if the end of the stream has been reached.

Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException - if an I/O error occurs

read

public int read(byte[] b)
         throws java.io.IOException
Reads up to b.length bytes of data from this input stream into an array of bytes. Returns -1 if the end of the stream has been reached.

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException - if an I/O error occurs

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads up to len bytes of data from this input stream into an array of bytes, starting at the specified offset. Returns -1 if the end of the stream has been reached.

Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException - if an I/O error occurs


© Copyright 2003 The Free Software Foundation, all rights reserved