Package org.apache.batik.util
Class Base64EncoderStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.batik.util.Base64EncoderStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
public class Base64EncoderStream extends java.io.OutputStreamThis 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: Base64EncoderStream.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]atom(package private) intatomLen(package private) booleancloseOutOnClose(package private) byte[]encodeBuf(package private) intlineLen(package private) java.io.PrintStreamoutprivate static byte[]pem_arrayThis array maps the 6 bit values to their characters
-
Constructor Summary
Constructors Constructor Description Base64EncoderStream(java.io.OutputStream out)Base64EncoderStream(java.io.OutputStream out, boolean closeOutOnClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) voidencodeAtom()enocodeAtom - Take three bytes of input and encode it as 4 printable characters.(package private) voidencodeFromArray(byte[] data, int offset, int len)enocodeAtom - Take three bytes of input and encode it as 4 printable characters.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)
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.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 interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] data) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] data, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
encodeAtom
void encodeAtom() throws java.io.IOExceptionenocodeAtom - Take three bytes of input and encode it as 4 printable characters. Note that if the length in len is less than three is encodes either one or two '=' signs to indicate padding characters.- Throws:
java.io.IOException
-
encodeFromArray
void encodeFromArray(byte[] data, int offset, int len) throws java.io.IOExceptionenocodeAtom - Take three bytes of input and encode it as 4 printable characters. Note that if the length in len is less than three is encodes either one or two '=' signs to indicate padding characters.- Throws:
java.io.IOException
-
-