Package com.avoka.core.util
Class CharsetUtils
- java.lang.Object
-
- com.avoka.core.util.CharsetUtils
-
public class CharsetUtils extends Object
Provides charset encoding utilities.
-
-
Constructor Summary
Constructors Constructor Description CharsetUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
decodeFromUTF8Bytes(byte[] value)
Convert the given UTF-8 encoded byte array to a string.static byte[]
encodeAsUTF8Bytes(String value)
Convert the given string to a UTF-8 encoded byte array.
-
-
-
Field Detail
-
UTF_8
public static final String UTF_8
The 'UTF-8' charset encoding constant.- See Also:
- Constant Field Values
-
-
Method Detail
-
encodeAsUTF8Bytes
public static byte[] encodeAsUTF8Bytes(String value)
Convert the given string to a UTF-8 encoded byte array.- Parameters:
value
- the string value to encode (required, not null)- Returns:
- the UTF-8 encoded byte array
-
decodeFromUTF8Bytes
public static String decodeFromUTF8Bytes(byte[] value)
Convert the given UTF-8 encoded byte array to a string.- Parameters:
value
- the the UTF-8 encoded byte array (required, not null)- Returns:
- the decoded string value
-
-