gnu.inet.util

Class MessageInputStream


public class MessageInputStream
extends java.io.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.

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

Author:
Chris Burdess

Field Summary

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

Constructor Summary

MessageInputStream(java.io.InputStream in)
Constructs a message input stream connected to the specified input stream.

Method Summary

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()

Field Details

END

public static final int END
The stream termination octet ('.').

Field Value:
46


LF

public static final int LF
The line termination octet ('\n').

Field Value:
10


buf1

protected int buf1


buf2

protected int buf2


eof

protected boolean eof


markBuf1

protected int markBuf1


markBuf2

protected int markBuf2

Constructor Details

MessageInputStream

public MessageInputStream(java.io.InputStream in)
Constructs a message input stream connected to the specified input stream.

Method Details

mark

public void mark(int readlimit)


markSupported

public boolean markSupported()


read

public int read()
            throws java.io.IOException
Reads the next byte of data from this message input stream. Returns -1 if the end of the message 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


© Copyright 2003 The Free Software Foundation, all rights reserved