public abstract class Base64Binary
extends java.lang.Object
Parsing and formatting functions for base-64 binary encoding.
Constructor and Description |
---|
Base64Binary() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
convert(java.lang.String text)
Parse base-64 encoded binary value.
|
static java.lang.String |
format(byte[] data)
Return
data encoded in base-64 binary format. |
static java.lang.String |
formatPadSafe(byte[] data,
boolean pad,
boolean safe)
Return
data encoded in base-64 binary format, with optional padding and optional URL-safe alphabet. |
static int |
getCharAsInt(char c)
For internal use only.
|
static char |
getIntAsChar(int i,
boolean safe)
For internal use only.
|
static byte[] |
parse(java.lang.String text)
Parse base-64 encoded binary value.
|
public static byte[] convert(java.lang.String text)
Parse base-64 encoded binary value.
FormatException
(fatal) if the text has invalid base-64 format.
text
- Base-64 encoded binary data.public static java.lang.String format(byte[] data)
Return data
encoded in base-64 binary format.
data
- Binary value.data
encoded in base-64 binary format.public static java.lang.String formatPadSafe(byte[] data, boolean pad, boolean safe)
Return data
encoded in base-64 binary format, with optional padding and optional URL-safe alphabet.
data
- Binary value.pad
- true
if the encoded data must be padded with '=' characters (see padding).safe
- true
if the encoded data must use a URL-safe alphabet.data
encoded in base-64 binary format, with optional padding and optional URL-safe alphabet.public static int getCharAsInt(char c)
For internal use only.
public static char getIntAsChar(int i, boolean safe)
For internal use only.
public static byte[] parse(java.lang.String text)
Parse base-64 encoded binary value.
text
- Base-64 encoded binary data.null' if
text` has an incorrect format.