public final class CodecUtil
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
CodecUtil()
Private constructor of utility class.
|
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
b32(byte[] raw)
Encodes bytes into base 32-encoded string.
|
static java.lang.String |
b32(byte[] raw,
int lineLength)
Encodes bytes into base32-encoded string.
|
static byte[] |
b32(java.lang.CharSequence encoded)
Decodes a base32-encoded string into raw bytes.
|
static java.lang.String |
b64(byte[] raw)
Encodes bytes into base 64-encoded string.
|
static java.lang.String |
b64(byte[] raw,
int lineLength)
Encodes bytes into base64-encoded string.
|
static byte[] |
b64(java.lang.CharSequence encoded)
Decodes a base64-encoded string into raw bytes.
|
static byte[] |
decode(Decoder decoder,
java.lang.CharSequence encoded)
Decodes the given encoded data using the given char-to-byte decoder.
|
static java.lang.String |
encode(Encoder encoder,
byte[] raw)
Encodes raw bytes using the given encoder.
|
static java.lang.String |
hex(byte[] raw)
Encodes raw bytes to the equivalent hexadecimal encoded string.
|
static java.lang.String |
hex(byte[] raw,
boolean delimit)
Encodes raw bytes to the equivalent hexadecimal encoded string with optional delimiting of output.
|
static byte[] |
hex(java.lang.CharSequence encoded)
Decodes a hexadecimal encoded string to raw bytes.
|
public static java.lang.String hex(byte[] raw)
throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static java.lang.String hex(byte[] raw,
boolean delimit)
throws EncodingException
raw - Raw bytes to encode.delimit - True to delimit every two characters (i.e. every byte) of output with ':' character, false
otherwise.EncodingException - on encoding errors.public static byte[] hex(java.lang.CharSequence encoded)
throws EncodingException
encoded - Hex encoded character data.EncodingException - on decoding errors.public static java.lang.String b64(byte[] raw)
throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static byte[] b64(java.lang.CharSequence encoded)
throws EncodingException
encoded - Base64-encoded character data.EncodingException - on decoding errors.public static java.lang.String b64(byte[] raw,
int lineLength)
throws EncodingException
raw - Raw bytes to encode.lineLength - Length of each base64-encoded line in output.EncodingException - on encoding errors.public static java.lang.String b32(byte[] raw)
throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static byte[] b32(java.lang.CharSequence encoded)
throws EncodingException
encoded - Base32-encoded character data.EncodingException - on decoding errors.public static java.lang.String b32(byte[] raw,
int lineLength)
throws EncodingException
raw - Raw bytes to encode.lineLength - Length of each base32-encoded line in output.EncodingException - on encoding errors.public static java.lang.String encode(Encoder encoder, byte[] raw) throws EncodingException
encoder - Encoder to perform byte-to-char conversion.raw - Raw bytes to encode.EncodingException - on encoding errors.public static byte[] decode(Decoder decoder, java.lang.CharSequence encoded) throws EncodingException
decoder - Decoder to perform char-to-byte conversion.encoded - Encoded character data.EncodingException - on decoding errors.