public final class HexCodec extends Object
Modifier and Type | Method | Description |
---|---|---|
static long |
lenientLowerHexToUnsignedLong(CharSequence lowerHex,
int index,
int endIndex) |
Like
lowerHexToUnsignedLong(CharSequence, int) , but returns zero on invalid input |
static long |
lowerHexToUnsignedLong(CharSequence lowerHex) |
Parses a 1 to 32 character lower-hex string with no prefix into an unsigned long, tossing any
bits higher than 64.
|
static long |
lowerHexToUnsignedLong(CharSequence lowerHex,
int index) |
Parses a 16 character lower-hex string with no prefix into an unsigned long, starting at the
specified index.
|
static String |
toLowerHex(long v) |
Inspired by
okio.Buffer.writeLong |
static String |
toLowerHex(long high,
long low) |
Returns 16 or 32 character hex string depending on if
high is zero. |
static void |
writeHexByte(char[] data,
int pos,
byte b) |
|
static void |
writeHexLong(char[] data,
int pos,
long v) |
Inspired by
okio.Buffer.writeLong |
public static long lowerHexToUnsignedLong(CharSequence lowerHex)
public static long lowerHexToUnsignedLong(CharSequence lowerHex, int index)
public static long lenientLowerHexToUnsignedLong(CharSequence lowerHex, int index, int endIndex)
lowerHexToUnsignedLong(CharSequence, int)
, but returns zero on invalid inputpublic static String toLowerHex(long high, long low)
high
is zero.public static String toLowerHex(long v)
okio.Buffer.writeLong
public static void writeHexLong(char[] data, int pos, long v)
okio.Buffer.writeLong
public static void writeHexByte(char[] data, int pos, byte b)
Copyright © 2018 OpenZipkin. All rights reserved.