Package org.apache.xmlgraphics.util.io
Class Base64EncodeStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.xmlgraphics.util.io.Base64EncodeStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
public class Base64EncodeStream extends OutputStream
This class implements a Base64 Character encoder as specified in RFC1113. Unlike some other encoding schemes there is nothing in this encoding that indicates where a buffer starts or ends. This means that the encoded text will simply start with the first line of encoded text and end with the last line of encoded text.- Version:
- $Id: Base64EncodeStream.java 1732018 2016-02-24 04:51:06Z gadams $ Originally authored by Thomas DeWeese, Vincent Hardy, and Chuck McManis.
-
-
Constructor Summary
Constructors Constructor Description Base64EncodeStream(OutputStream out)Base64EncodeStream(OutputStream out, boolean closeOutOnClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()This can't really flush out output since that may generate '=' chars which would indicate the end of the stream.voidwrite(byte[] data)voidwrite(byte[] data, int off, int len)voidwrite(int b)-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
Base64EncodeStream
public Base64EncodeStream(OutputStream out)
-
Base64EncodeStream
public Base64EncodeStream(OutputStream out, boolean closeOutOnClose)
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStream- Throws:
IOException
-
flush
public void flush() throws IOExceptionThis can't really flush out output since that may generate '=' chars which would indicate the end of the stream. Instead we flush out. You can only be sure all output is writen by closing this stream.- Specified by:
flushin interfaceFlushable- Overrides:
flushin classOutputStream- Throws:
IOException
-
write
public void write(int b) throws IOException- Specified by:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] data) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
write
public void write(byte[] data, int off, int len) throws IOException- Overrides:
writein classOutputStream- Throws:
IOException
-
-