Class StringTools

java.lang.Object
org.savantbuild.lang.StringTools

public class StringTools extends Object
This is a toolkit with String helper methods.
  • Constructor Details

    • StringTools

      public StringTools()
  • Method Details

    • fromHex

      public static byte[] fromHex(String hexString)
      Converts the contents of the given String from hexadecimal to an array of bytes. Each character of the String is a single hex value. Therefore, the pair of characters equals a single byte. This method is little-endian.
      Parameters:
      hexString - The hex String to convert
      Returns:
      An array of bytes
    • toHex

      public static String toHex(byte... hexBytes)
      Converts the contents of the given byte array from hexadecimal to a hex String. Each character of the String is a single hex value. Therefore, the the pair of characters equals a single byte.
      Parameters:
      hexBytes - The hex byte array to convert.
      Returns:
      A hex String.