public class Base64Decoder
extends java.lang.Object
Base64Encoder
Modifier and Type | Field and Description |
---|---|
(package private) java.io.InputStream |
in |
(package private) java.io.OutputStream |
out |
(package private) boolean |
stringp |
Constructor and Description |
---|
Base64Decoder(java.io.InputStream in,
java.io.OutputStream out)
Create a decoder to decode a stream.
|
Base64Decoder(java.lang.String input)
Create a decoder to decode a String.
|
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBase64Bytes(java.lang.String base64String)
Decode a base64 encoded string to array of bytes with a default charset .
|
static byte[] |
decodeBase64Bytes(java.lang.String base64String,
java.lang.String charset)
Decode a base64 encoded string to array of bytes with a charset.
|
static java.lang.Object |
decodeBase64Object(java.lang.String base64String)
Decode a base64 encoded string to an object with a default charset .
|
static java.lang.Object |
decodeBase64Object(java.lang.String base64String,
java.lang.String charset)
Decode a base64 encoded string to an object with a charset.
|
static void |
main(java.lang.String[] args)
Test the decoder.
|
void |
process()
Do the actual decoding.
|
java.lang.String |
processString()
Do the decoding, and return a String.
|
public Base64Decoder(java.lang.String input)
input
- The string to be decoded.public Base64Decoder(java.io.InputStream in, java.io.OutputStream out)
in
- The input stream (to be decoded).out
- The output stream, to write decoded data to.public void process() throws java.io.IOException, Base64FormatException
java.io.IOException
- If the input or output stream accesses failed.Base64FormatException
- If the input stream is not compliant
with the BASE64 specification.public java.lang.String processString() throws Base64FormatException
java.lang.RuntimeException
- If the object wasn't constructed to
decode a String.Base64FormatException
- If the input string is not compliant
with the BASE64 specification.public static byte[] decodeBase64Bytes(java.lang.String base64String) throws java.lang.IllegalThreadStateException
base64String,
- a base64 encoded stringjava.lang.IllegalThreadStateException
public static byte[] decodeBase64Bytes(java.lang.String base64String, java.lang.String charset) throws java.lang.IllegalThreadStateException
base64String,
- a base64 encoded stringcharset,
- charset used to translate string to bytes.java.lang.IllegalThreadStateException
public static java.lang.Object decodeBase64Object(java.lang.String base64String) throws java.lang.IllegalThreadStateException
base64String,
- a base64 encoded string, representing a Serializable objectjava.lang.IllegalThreadStateException
public static java.lang.Object decodeBase64Object(java.lang.String base64String, java.lang.String charset) throws java.lang.IllegalThreadStateException
base64String,
- a base64 encoded string, representing a Serializable objectcharset,
- charset used to translate string to bytes.java.lang.IllegalThreadStateException
public static void main(java.lang.String[] args)
Copyright © SAS Institute. All Rights Reserved.