public abstract class Base64Utils extends Object
Constructor and Description |
---|
Base64Utils() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
decode(byte[] src)
Base64-decode the given byte array.
|
static byte[] |
decodeFromString(String src)
Base64-decode the given byte array from an UTF-8 String.
|
static byte[] |
encode(byte[] src)
Base64-encode the given byte array.
|
static String |
encodeToString(byte[] src)
Base64-encode the given byte array to a String.
|
public static byte[] encode(byte[] src)
src
- the original byte array (may be null
)null
if the input was null
)IllegalStateException
- if Base64 encoding is not supported,
i.e. neither Java 8 nor Apache Commons Codec is present at runtimepublic static String encodeToString(byte[] src)
src
- the original byte array (may be null
)null
if the input was null
)IllegalStateException
- if Base64 encoding is not supported,
i.e. neither Java 8 nor Apache Commons Codec is present at runtimepublic static byte[] decode(byte[] src)
src
- the encoded byte array (may be null
)null
if the input was null
)IllegalStateException
- if Base64 encoding is not supported,
i.e. neither Java 8 nor Apache Commons Codec is present at runtimepublic static byte[] decodeFromString(String src)
src
- the encoded UTF-8 String (may be null
)null
if the input was null
)IllegalStateException
- if Base64 encoding is not supported,
i.e. neither Java 8 nor Apache Commons Codec is present at runtime