Class DatatypeConverter


  • public class DatatypeConverter
    extends java.lang.Object
    Author:
    mn
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isHexString​(java.lang.String string)  
      static byte[] parseHexBinary​(java.lang.String hexString)
      Parse the string and return the represented value
      static java.lang.String toHexString​(byte[] data)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DatatypeConverter

        public DatatypeConverter()
    • Method Detail

      • parseHexBinary

        public static byte[] parseHexBinary​(java.lang.String hexString)
        Parse the string and return the represented value
        Parameters:
        hexString - the hex string
        Returns:
        the byte array which represent the hex string
        Throws:
        java.lang.NumberFormatException - if the hex string have a wrong sign or the length is not straight.
      • toHexString

        public static java.lang.String toHexString​(byte[] data)
        Parameters:
        data - bytes
        Returns:
        hex string
      • isHexString

        public static boolean isHexString​(java.lang.String string)
        Parameters:
        string - string
        Returns:
        true if it is a hex string;