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)
raw
- Raw bytes to encode.public static String hex(byte[] raw, boolean delimit)
raw
- Raw bytes to encode.delimit
- True to delimit every two characters (i.e. every byte) of
output with ':' character, false otherwise.public static byte[] hex(CharSequence encoded)
encoded
- Hex encoded character data.public static String b64(byte[] raw)
raw
- Raw bytes to encode.public static byte[] b64(CharSequence encoded)
encoded
- Base64-encoded character data.public static String b64(byte[] raw, int lineLength)
raw
- Raw bytes to encode.lineLength
- Length of each base64-encoded line in output.public static String b32(byte[] raw)
raw
- Raw bytes to encode.public static byte[] b32(CharSequence encoded)
encoded
- Base32-encoded character data.public static String b32(byte[] raw, int lineLength)
raw
- Raw bytes to encode.lineLength
- Length of each base32-encoded line in output.public static String encode(Encoder encoder, byte[] raw)
encoder
- Encoder to perform byte-to-char conversion.raw
- Raw bytes to encode.public static byte[] decode(Decoder decoder, CharSequence encoded)
decoder
- Decoder to perform char-to-byte conversion.encoded
- Encoded character data.Copyright © 2016 JBoss by Red Hat. All rights reserved.