public class StringEncoder extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static char[] |
xdigits |
| Constructor and Description |
|---|
StringEncoder() |
| Modifier and Type | Method and Description |
|---|---|
private static byte[] |
byteCopy(byte[] source,
int offset,
int count,
byte[] target)
Copies count elements from source, starting at element with
index offset, to the given target.
|
static byte[] |
decode(String s)
Decodes the given string that is assumed to be a valid encoding
of a byte array.
|
static String |
encode(byte[] a)
Encodes the given byte array into a string that can be used by
the SQLite database.
|
static String |
encodeX(byte[] a)
Encodes the given byte array into SQLite3 blob notation, ie X'..'
|
private static byte[] byteCopy(byte[] source,
int offset,
int count,
byte[] target)
source - the source.offset - the offset.count - the number of elements to be copied.target - the target to be returned.public static byte[] decode(String s)
encode method.s - the given string encoding.IllegalArgumentException - when the string given is not
a valid encoded string for this encoder.public static String encode(byte[] a)
a - the byte array to be encoded. A null reference is handled as
an empty array.decode method
a string of size 1 will return an empty byte array.public static String encodeX(byte[] a)
a - the byte array to be encoded. A null reference is handled as
an empty array.Contact: Christian Werner