java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
gnu.mail.providers.mbox.MboxOutputStream
- class MboxOutputStream
- extends java.io.FilterOutputStream
A filter stream that can escape mbox From_ lines in message content.
This will only work reliably for messages with <4096 bytes in any one
line.
|
Field Summary |
protected byte[] |
buf
The buffer where the current line is stored. |
protected int |
count
The number of valid bytes in the buffer. |
private static byte |
KET
|
|
Method Summary |
void |
flush()
Flushes this output stream. |
protected void |
validateAndFlushBuffer()
Flush the internal buffer. |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Writes the specified byte to this output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KET
private static byte KET
buf
protected byte[] buf
- The buffer where the current line is stored.
count
protected int count
- The number of valid bytes in the buffer.
MboxOutputStream
public MboxOutputStream(java.io.OutputStream out)
- Constructs an mbox From_-escaping output stream with a buffer size of
1024 bytes.
MboxOutputStream
public MboxOutputStream(java.io.OutputStream out,
int len)
- Constructs an mbox From_-escaping output stream with the specified
buffer size.
validateAndFlushBuffer
protected void validateAndFlushBuffer()
throws java.io.IOException
- Flush the internal buffer.
write
public void write(int b)
throws java.io.IOException
- Writes the specified byte to this output stream.
write
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
- Writes
len bytes from the specified byte array
starting at offset off to this output stream.
flush
public void flush()
throws java.io.IOException
- Flushes this output stream.