Package spark.utils.urldecoding
Class TypeUtil
java.lang.Object
spark.utils.urldecoding.TypeUtil
TYPE Utilities.
Provides various static utiltiy methods for manipulating types and their
string representations.
- Since:
- Jetty 4.1
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intconvertHexDigit(char c) static intconvertHexDigit(int c) static intParse an int from a substring.static StringtoHexString(byte b) static StringtoHexString(byte[] b, int offset, int length) static StringtoString(byte[] bytes, int base)
-
Field Details
-
name2Class
-
class2Name
-
class2Value
-
-
Constructor Details
-
TypeUtil
public TypeUtil()
-
-
Method Details
-
parseInt
Parse an int from a substring. Negative numbers are not handled.- Parameters:
s- Stringoffset- Offset within stringlength- Length of integer or -1 for remainder of stringbase- base of the integer- Returns:
- the parsed integer
- Throws:
NumberFormatException- if the string cannot be parsed
-
toString
-
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
-
toHexString
-