public class Base64OutputStream
extends java.io.FilterOutputStream
From RFC 2045, section 6.8:
The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the unencoded data.
Constructor and Description |
---|
Base64OutputStream(java.io.OutputStream out)
Default constructor.
|
Base64OutputStream(java.io.OutputStream out,
int lineLength)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this output stream and releases any system resources
associated with this stream.
|
void |
flush()
Flushes this output stream and forces any buffered output bytes to be
written out.
|
void |
write(byte[] b)
Writes
b.length bytes from the specified byte array
to this output stream. |
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 c)
Writes the specified byte to this output stream.
|
public Base64OutputStream(java.io.OutputStream out)
public Base64OutputStream(java.io.OutputStream out, int lineLength)
out
- the underlying output stream to encodelineLength
- the line lengthpublic void write(int c) throws java.io.IOException
write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
b.length
bytes from the specified byte array
to this output stream.write
in class java.io.FilterOutputStream
java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.write
in class java.io.FilterOutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.FilterOutputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.FilterOutputStream
java.io.IOException