Class CharsetUtils


  • public class CharsetUtils
    extends Object
    Provides charset encoding utilities.
    • Constructor Detail

      • CharsetUtils

        public CharsetUtils()
    • 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