public class Base16
extends java.lang.Object
Note: The conversion of Java strings to bytes using UTF-8 is not order-preserving, because the binary order of UTF-16 is different from UTF-8 in the case of supplementary characters.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encode(byte[] value)
Encodes a byte array into Base16 notation.
|
void |
encode(byte[] value,
java.lang.StringBuilder builder)
Encodes a byte array into Base16 notation and appends the result
to the
StringBuilder . |
void |
encode(byte b,
java.lang.StringBuilder builder)
Encodes a single byte into Base16 notation and appends the result
to the
StringBuilder . |
java.lang.String |
encode(java.lang.String value)
Encodes a string into Base16 notation.
|
static Base16 |
lowerCase()
Constructs a Base16 encoder that uses lowercase hex letters (a-f).
|
static Base16 |
upperCase()
Constructs a Base16 encoder that uses uppercase hex letters (A-F).
|
public static Base16 lowerCase()
public static Base16 upperCase()
public java.lang.String encode(java.lang.String value)
value
- the data to convertpublic java.lang.String encode(byte[] value)
value
- the data to convertpublic void encode(byte[] value, java.lang.StringBuilder builder)
StringBuilder
.value
- the data to convertbuilder
- the StringBuilder
to append the encoded string topublic void encode(byte b, java.lang.StringBuilder builder)
StringBuilder
.b
- the byte to convertbuilder
- the StringBuilder
to append the encoded string to