public class Base64
extends java.lang.Object
Base64
offers methods to do BASE-64 encoding and decoding.
BASE-64 is an industrial standard to encode any 3-byte binary data into 4 normal ASCII codes.
Constructor and Description |
---|
Base64() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] base64Data)
Decode the input data which is BASE-64 encoded.
|
static byte[] |
encode(byte[] data)
Encode the input byte array and produce a BASE-64 encoded byte array.
|
public static byte[] encode(byte[] data) throws PDFException
data
- A byte array, which is to be encoded into a BASE-64 byte array.
It should not be null
. PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public static byte[] decode(byte[] base64Data) throws PDFException
base64Data
- A byte array which stores the original BASE-64 encoded data.
It should be valid BASE-64 encoded data, otherwise PDFException.ERRCODE_FORMAT
will be thrown.PDFException
- PDFException.ERRCODE_FORMAT
will be thrown if input parameter base64Data
contains incorrect format bytes.
PDFException.ERRCODE_XXX
.PDFException