Class ConversionHelper


  • public class ConversionHelper
    extends Object
    Helper class for converting data types.
    • Method Detail

      • byteToHexString

        public static String byteToHexString​(byte[] bytes)
        Convert byte[] to String in hex notation.
      • byteOrNullToHexString

        public static String byteOrNullToHexString​(byte[] bytes)
        Convert byte[] to String in hex notation. If bytes is null returns empty string.
      • byteToBase64String

        public static String byteToBase64String​(byte[] bytes)
        Convert byte[] to String in base64 notation.
      • byteOrNullToBase64String

        public static String byteOrNullToBase64String​(byte[] bytes)
        Convert byte[] to String in base64 notation. If bytes is null returns empty string.
      • hexStringToByte

        public static byte[] hexStringToByte​(String string)
        Convert String in hex notation to byte[]. Invalid characters are assumed to be 0.
      • base64StringToByte

        public static byte[] base64StringToByte​(String s)
        Convert String in base64 notation to byte[]. Invalid characters are assumed to be 0.