Package datadog.trace.api.internal.util
Class LongStringUtils
java.lang.Object
datadog.trace.api.internal.util.LongStringUtils
Utility class with common long decimal and hexadecimal parsing, and
String creation
methods.-
Method Summary
Modifier and TypeMethodDescriptionstatic NumberFormatExceptionCreates aNumberFormatExceptionwith a consistent error message.static longstatic longParse the hex representation of the unsigned 64 bit long from theString.static longparseUnsignedLongHex(CharSequence s, int start, int len, boolean lowerCaseOnly) Parse the hex representation of the unsigned 64 bit long from theString.static StringtoHexStringPadded(long id, int size) static StringtoHexStringPadded(long highOrderBits, long lowOrderBits, int size)
-
Method Details
-
parseUnsignedLongHex
Parse the hex representation of the unsigned 64 bit long from theString.- Parameters:
s- String in hexadecimal of unsigned 64-bits long.- Returns:
- long
- Throws:
NumberFormatException
-
parseUnsignedLongHex
public static long parseUnsignedLongHex(CharSequence s, int start, int len, boolean lowerCaseOnly) throws NumberFormatException Parse the hex representation of the unsigned 64 bit long from theString.- Parameters:
s- String in hex of unsigned 64 bitsstart- the start index of the hex valuelen- the len of the hex valuelowerCaseOnly- if the allowed hex characters are lower case only- Returns:
- long
- Throws:
NumberFormatException
-
parseUnsignedLong
- Throws:
NumberFormatException
-
numberFormatOutOfLongRange
Creates aNumberFormatExceptionwith a consistent error message.- Parameters:
s- theStringthat exceeds the range of aLong- Returns:
- NumberFormatException
-
toHexStringPadded
-
toHexStringPadded
-