gnu.inet.util

Class CRLFInputStream


public class CRLFInputStream
extends java.io.FilterInputStream

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

Version:
$Revision: 1.3 $ $Date: 2004/06/08 19:05:28 $

Author:
Chris Burdess

Field Summary

static int
CR
The CR octet.
static int
LF
The LF octet.
protected int
buf
Buffer.
protected int
markBuf
Buffer at time of mark.

Constructor Summary

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

Method Summary

void
mark(int readlimit)
Marks the current position in this stream.
boolean
markSupported()
Indicates whether this stream supports the mark and reset methods.
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.
void
reset()
Repositions this stream to the position at the time the mark method was called.

Field Details

CR

public static final int CR
The CR octet.

Field Value:
13


LF

public static final int LF
The LF octet.

Field Value:
10


buf

protected int buf
Buffer.


markBuf

protected int markBuf
Buffer at time of mark.

Constructor Details

CRLFInputStream

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

Method Details

mark

public void mark(int readlimit)
Marks the current position in this stream.


markSupported

public boolean markSupported()
Indicates whether this stream supports the mark and reset methods.


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.

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.

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.

Throws:
java.io.IOException - if an I/O error occurs


reset

public void reset()
            throws java.io.IOException
Repositions this stream to the position at the time the mark method was called.


© Copyright 2003 The Free Software Foundation, all rights reserved