Class TypeUtil

java.lang.Object
spark.utils.urldecoding.TypeUtil

public class TypeUtil extends Object
TYPE Utilities. Provides various static utiltiy methods for manipulating types and their string representations.
Since:
Jetty 4.1
  • Field Details

  • Constructor Details

    • TypeUtil

      public TypeUtil()
  • Method Details

    • parseInt

      public static int parseInt(String s, int offset, int length, int base) throws NumberFormatException
      Parse an int from a substring. Negative numbers are not handled.
      Parameters:
      s - String
      offset - Offset within string
      length - Length of integer or -1 for remainder of string
      base - base of the integer
      Returns:
      the parsed integer
      Throws:
      NumberFormatException - if the string cannot be parsed
    • toString

      public static String toString(byte[] bytes, int base)
    • convertHexDigit

      public static int convertHexDigit(char c)
      Parameters:
      c - An ASCII encoded character 0-9 a-f A-F
      Returns:
      The byte value of the character 0-16.
    • convertHexDigit

      public static int convertHexDigit(int c)
      Parameters:
      c - An ASCII encoded character 0-9 a-f A-F
      Returns:
      The byte value of the character 0-16.
    • toHexString

      public static String toHexString(byte b)
    • toHexString

      public static String toHexString(byte[] b, int offset, int length)