Package org.apache.batik.util
Class Base64DecodeStream
- java.lang.Object
-
- java.io.InputStream
-
- org.apache.batik.util.Base64DecodeStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class Base64DecodeStream extends java.io.InputStreamThis class implements a Base64 Character decoder as specified in RFC1113. Unlike some other encoding schemes there is nothing in this encoding that tells the decoder where a buffer starts or stops, so to use it you will need to isolate your encoded data into a single chunk and then feed them this decoder. The simplest way to do that is to read all of the encoded data into a string and then use:byte data[]; InputStream is = new ByteArrayInputStream(data); is = new Base64DecodeStream(is);On errors, this class throws a IOException with the following detail strings:"Base64DecodeStream: Bad Padding byte (2)." "Base64DecodeStream: Bad Padding byte (1)."- Version:
- $Id: Base64DecodeStream.java 1831630 2018-05-15 12:56:55Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description (package private) byte[]decode_buffer(package private) booleanEOF(package private) byte[]out_buffer(package private) intout_offsetprivate static byte[]pem_array(package private) java.io.InputStreamsrc
-
Constructor Summary
Constructors Constructor Description Base64DecodeStream(java.io.InputStream src)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()(package private) booleangetNextAtom()booleanmarkSupported()intread()intread(byte[] out, int offset, int len)
-
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classjava.io.InputStream
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
available
public int available() throws java.io.IOException- Overrides:
availablein classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
read
public int read(byte[] out, int offset, int len) throws java.io.IOException- Overrides:
readin classjava.io.InputStream- Throws:
java.io.IOException
-
getNextAtom
final boolean getNextAtom() throws java.io.IOException- Throws:
java.io.IOException
-
-