|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.util.Convert
public final class Convert
Utility class provides static methods to perform common conversions.
| Field Summary | |
|---|---|
static Charset |
ASCII_CHARSET
ASCII character set used for all encoding methods. |
static String |
CHARSET_PROPERTY
System property used to specify character set. |
static Charset |
DEFAULT_CHARSET
Default character set. |
| Method Summary | |
|---|---|
static byte[] |
fromBase64(String base64)
Converts base64-encoded string of bytes into the original byte array. |
static byte[] |
fromHex(String hex)
Converts hexadecimal string of bytes into the original byte array. |
static Charset |
getDefaultCharset()
Gets the default charset used for character/byte conversions. |
static byte[] |
toAsciiBytes(String input)
Converts a string to bytes in the ASCII character set. |
static String |
toBase64(byte[] input)
Converts a byte array into a base-64 encoded string without any line breaks. |
static byte[] |
toBytes(char[] input)
Converts a character array to a byte array in the default character set. |
static byte[] |
toBytes(String input)
Converts a string to bytes in the default character set. |
static byte[] |
toBytes(String[] input)
Convers an array of strings into a byte array produced by concatenating the byte representation of each string in the default character set. |
static String |
toHex(byte[] input)
Converts a byte array into a hexadecimal string representation of the bytes. |
static String |
toString(byte[] input)
Converts a byte array to a string in the default encoding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CHARSET_PROPERTY
public static final Charset ASCII_CHARSET
public static final Charset DEFAULT_CHARSET
| Method Detail |
|---|
public static Charset getDefaultCharset()
DEFAULT_CHARSET.
public static byte[] toBytes(String[] input)
input - String to convert
public static byte[] toBytes(String input)
input - String to convert.
public static byte[] toBytes(char[] input)
input - Character array to convert.
public static byte[] toAsciiBytes(String input)
input - String to convert.
public static String toString(byte[] input)
input - Byte array to convert.
public static byte[] fromHex(String hex)
hex - Hexadecimal string of bytes.
public static String toHex(byte[] input)
input - Byte array to convert
public static byte[] fromBase64(String base64)
base64 - Base64-encoded string of bytes.
public static String toBase64(byte[] input)
input - Byte array to convert.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||