gnu.inet.util
Class MessageInputStream
FilterInputStream
gnu.inet.util.MessageInputStream
public class MessageInputStream
extends FilterInputStream
A utility class for feeding message contents to messages.
This stream returns -1 from read
when the stream termination
sequence LF,END,LF is read from the underlying stream.
static int | END - The stream termination octet ('.').
|
static int | LF - The line termination octet ('\n').
|
protected int | buf1
|
protected int | buf2
|
protected boolean | eof
|
protected int | markBuf1
|
protected int | markBuf2
|
MessageInputStream(InputStream in) - Constructs a message input stream connected to the specified input stream.
|
void | mark(int readlimit)
|
boolean | markSupported()
|
int | read() - Reads the next byte of data from this message 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()
|
END
public static final int END
The stream termination octet ('.').
LF
public static final int LF
The line termination octet ('\n').
markBuf1
protected int markBuf1
markBuf2
protected int markBuf2
MessageInputStream
public MessageInputStream(InputStream in)
Constructs a message input stream connected to the specified input stream.
mark
public void mark(int readlimit)
markSupported
public boolean markSupported()
read
public int read()
throws IOException
Reads the next byte of data from this message input stream.
Returns -1 if the end of the message stream has been reached.
read
public int read(byte[] b)
throws 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.
read
public int read(byte[] b,
int off,
int len)
throws 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.
reset
public void reset()
throws IOException