-
- All Implemented Interfaces:
-
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class Base64.OutputStream extends FilterOutputStream
A OutputStream will write data to anotherjava.io.OutputStream, given in the constructor,and encode/decode to/from Base64 notation on the fly.
-
-
Constructor Summary
Constructors Constructor Description Base64.OutputStream(OutputStream out)Constructs a OutputStream in ENCODE mode. Base64.OutputStream(OutputStream out, int options)Constructs a OutputStream in either ENCODE or DECODE mode.
-
Method Summary
Modifier and Type Method Description voidwrite(int theByte)Writes the byte to the output stream after converting to/from Base64 notation. voidwrite(Array<byte> theBytes, int off, int len)Calls write repeatedly until len bytes are written. voidflushBase64()Method added by PHIL. voidclose()Flushes and closes (I think, in the superclass) the stream. -
-
Constructor Detail
-
Base64.OutputStream
Base64.OutputStream(OutputStream out)
Constructs a OutputStream in ENCODE mode.- Parameters:
out- the java.io.
-
Base64.OutputStream
Base64.OutputStream(OutputStream out, int options)
Constructs a OutputStream in either ENCODE or DECODE mode.- Parameters:
out- the java.io.options- Specified options.
-
-
Method Detail
-
write
void write(int theByte)
Writes the byte to the output stream after converting to/from Base64 notation. When encoding,bytes are buffered three at a time before the output stream actually gets a write() call.When decoding, bytes are buffered four at a time.
- Parameters:
theByte- the byte to write
-
write
void write(Array<byte> theBytes, int off, int len)
Calls write repeatedly until len bytes are written.
- Parameters:
theBytes- array from which to read bytesoff- offset for arraylen- max number of bytes to read into array
-
flushBase64
void flushBase64()
Method added by PHIL. [Thanks, PHIL. -Rob] This pads the buffer without closing the stream.
-
close
void close()
Flushes and closes (I think, in the superclass) the stream.
-
-
-
-