public final class CodecUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
b32(byte[] raw)
Encodes bytes into base 32-encoded string.
|
static String |
b32(byte[] raw,
int lineLength)
Encodes bytes into base32-encoded string.
|
static byte[] |
b32(CharSequence encoded)
Decodes a base32-encoded string into raw bytes.
|
static String |
b64(byte[] raw)
Encodes bytes into base 64-encoded string.
|
static String |
b64(byte[] raw,
int lineLength)
Encodes bytes into base64-encoded string.
|
static byte[] |
b64(CharSequence encoded)
Decodes a base64-encoded string into raw bytes.
|
static byte[] |
decode(Decoder decoder,
CharSequence encoded)
Decodes the given encoded data using the given char-to-byte decoder.
|
static String |
encode(Encoder encoder,
byte[] raw)
Encodes raw bytes using the given encoder.
|
static String |
hex(byte[] raw)
Encodes raw bytes to the equivalent hexadecimal encoded string.
|
static String |
hex(byte[] raw,
boolean delimit)
Encodes raw bytes to the equivalent hexadecimal encoded string with optional delimiting of output.
|
static byte[] |
hex(CharSequence encoded)
Decodes a hexadecimal encoded string to raw bytes.
|
public static String hex(byte[] raw) throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static 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(CharSequence encoded) throws EncodingException
encoded - Hex encoded character data.EncodingException - on decoding errors.public static String b64(byte[] raw) throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static byte[] b64(CharSequence encoded) throws EncodingException
encoded - Base64-encoded character data.EncodingException - on decoding errors.public static 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 String b32(byte[] raw) throws EncodingException
raw - Raw bytes to encode.EncodingException - on encoding errors.public static byte[] b32(CharSequence encoded) throws EncodingException
encoded - Base32-encoded character data.EncodingException - on decoding errors.public static 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 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, CharSequence encoded) throws EncodingException
decoder - Decoder to perform char-to-byte conversion.encoded - Encoded character data.EncodingException - on decoding errors.Copyright © 2003-2024 Virginia Tech. All Rights Reserved.