⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
gnu.mail.util

Class RFC2822OutputStream

FilterOutputStream
|
+--gnu.mail.util.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.
Author:

Field Summary

static int

CR

The CR octet.

static int

LF

The LF octet.

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

Writes a character to the underlying stream.

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.

Field Details

CR

public static final int CR

The CR octet.


LF

public static final int LF

The LF octet.


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)

Writes a byte array to the underlying stream.

Parameters:
b
Throws:
- if an I/O error occurred

write

public void write(byte[] b, int off, int len)

Writes a portion of a byte array to the underlying stream.

Parameters:
b
off
len
Throws:
- if an I/O error occurred

write

public void write(int ch)

Writes a character to the underlying stream.

Parameters:
ch
Throws:
- if an I/O error occurred