Class HexUtils
java.lang.Object
io.servicetalk.opentracing.internal.HexUtils
Utilities for hex strings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringhexBytesOfLong(long v) Builds an hexStringthat represents the providedlongvalue.static longlongOfHexBytes(String str, int offset) Retrieves thelongvalue represented by the provided hexString.static <T extends CharSequence>
TvalidateHexBytes(T str) Checks that the providedCharSequenceis a valid hexCharSequence, throwing anIllegalArgumentExceptionif it is not.
-
Method Details
-
validateHexBytes
Checks that the providedCharSequenceis a valid hexCharSequence, throwing anIllegalArgumentExceptionif it is not.- Type Parameters:
T- The type ofCharSequenceto validate.- Parameters:
str- theCharSequenceto check.- Returns:
- the provided
CharSequenceunchanged.
-
longOfHexBytes
Retrieves thelongvalue represented by the provided hexString. ThrowsStringIndexOutOfBoundsExceptionif offset is invalid.- Parameters:
str- an hexString.offset- The index to start withinstrto start the conversion.- Returns:
- the
longvalue.
-
hexBytesOfLong
Builds an hexStringthat represents the providedlongvalue.- Parameters:
v- thelongvalue.- Returns:
- an hex
String.
-