public class ConvertionUtils extends Object
| Constructor and Description |
|---|
ConvertionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
base64ToArray(String value)
Decode Base64 string to byte array.
|
static String |
base64ToString(byte[] bytes)
Decode Base64 byte array to string.
|
static String |
base64ToString(String value)
Decode Base64 string to string.
|
static com.google.gson.Gson |
getGson() |
static byte[] |
toBase64Array(String value)
Convert string to Base64 byte array.
|
static String |
toBase64String(byte[] bytes)
Encode byte array as Base64 string.
|
static String |
toBase64String(String value)
Encode string to Base64 string.
|
static byte[] |
toBytes(String string)
Convert
String to byte array. |
static String |
toString(byte[] bytes)
Convert byte array to
String. |
static String |
toString(InputStream is)
Get the contents of an
InputStream as a String using UTF-8
character encoding. |
public static com.google.gson.Gson getGson()
public static byte[] toBytes(String string)
String to byte array.string - the string to converted.public static String toString(byte[] bytes)
String.bytes - the byte array to be converted.public static String toBase64String(String value)
value - the string to be converted.public static byte[] toBase64Array(String value)
value - the string to be converted.public static String toBase64String(byte[] bytes)
bytes - the byte array to be encoded.public static String base64ToString(String value)
value - the base64-encoded string to be converted.public static byte[] base64ToArray(String value)
value - The string to be converted.public static String base64ToString(byte[] bytes)
bytes - the base64-encoded byte array.public static String toString(InputStream is)
InputStream as a String using UTF-8
character encoding.is - the input stream.Copyright © 2016. All rights reserved.