gnu.mail.util

Class RFC2822OutputStream


public class RFC2822OutputStream
extends FilterOutputStream

An output stream that ensures that lines of characters in the body are limited to 998 octets(excluding CRLF). This is required by RFC 2822, section 2.3.

Field Summary

static int
CR
The CR octet.
static int
LF
The LF octet.
protected int
count
The number of bytes in the line.

Constructor Summary

RFC2822OutputStream(OutputStream out)
Constructs an RFC2822 output stream connected to the specified output stream.

Method Summary

void
write(byte[] b)
Writes a byte array to the underlying stream.
void
write(byte[] b, int off, int len)
Writes a portion of a byte array to the underlying stream.
void
write(int ch)
Writes a character to the underlying stream.

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


count

protected int count
The number of bytes in the line.

Constructor Details

RFC2822OutputStream

public RFC2822OutputStream(OutputStream out)
Constructs an RFC2822 output stream connected to the specified output stream.

Parameters:
out - the underlying OutputStream

Method Details

write

public void write(byte[] b)
            throws IOException
Writes a byte array to the underlying stream.


write

public void write(byte[] b,
                  int off,
                  int len)
            throws IOException
Writes a portion of a byte array to the underlying stream.


write

public void write(int ch)
            throws IOException
Writes a character to the underlying stream.