org.apache.geronimo.mail.util
Class Base64EncoderStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.geronimo.mail.util.Base64EncoderStream
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable
public class Base64EncoderStream
- extends java.io.FilterOutputStream
An implementation of a FilterOutputStream that encodes the
stream data in BASE64 encoding format. This version does the
encoding "on the fly" rather than encoding a single block of
data. Since this version is intended for use by the MimeUtilty class,
it also handles line breaks in the encoded data.
- Version:
- $Rev: 467553 $ $Date: 2006-10-25 06:01:51 +0200 (Wed, 25 Oct 2006) $
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary |
Base64EncoderStream(java.io.OutputStream out)
Create a Base64 encoder stream that wraps a specifed stream
using the default line break size. |
Base64EncoderStream(java.io.OutputStream out,
int lineBreak)
|
Method Summary |
void |
close()
|
void |
flush()
|
void |
write(byte[] data)
|
void |
write(byte[] data,
int offset,
int length)
|
void |
write(int ch)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CRLF
protected static final byte[] CRLF
encoder
protected Base64Encoder encoder
DEFAULT_LINEBREAK
protected static final int DEFAULT_LINEBREAK
- See Also:
- Constant Field Values
bufferedBytes
protected int bufferedBytes
buffer
protected byte[] buffer
lineBreak
protected int lineBreak
outputCount
protected int outputCount
Base64EncoderStream
public Base64EncoderStream(java.io.OutputStream out)
- Create a Base64 encoder stream that wraps a specifed stream
using the default line break size.
- Parameters:
out
- The wrapped output stream.
Base64EncoderStream
public Base64EncoderStream(java.io.OutputStream out,
int lineBreak)
write
public void write(int ch)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterOutputStream
- Throws:
java.io.IOException
write
public void write(byte[] data)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterOutputStream
- Throws:
java.io.IOException
write
public void write(byte[] data,
int offset,
int length)
throws java.io.IOException
- Overrides:
write
in class java.io.FilterOutputStream
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Overrides:
close
in class java.io.FilterOutputStream
- Throws:
java.io.IOException
flush
public void flush()
throws java.io.IOException
- Specified by:
flush
in interface java.io.Flushable
- Overrides:
flush
in class java.io.FilterOutputStream
- Throws:
java.io.IOException
Copyright © {inceptionYear}-2008 null. All Rights Reserved.