Top Fields Constructors Methods
org.apache.hc.client5.http.utils

public Class Hex

extends Object
Class Inheritance
Annotations
@Internal
Imports
org.apache.hc.core5.annotation.Internal

Field Summary

Modifier and TypeField and Description
private static final char[]
DIGITS_LOWER

Used to build output as hex.

Constructor Summary

AccessConstructor and Description
private
Hex()

Method Summary

Modifier and TypeMethod and Description
private static void
encodeHex(final byte[]
a byte[] to convert to hex characters
data
,
final int
the position in data to start encoding from
dataOffset
,
final int
the number of bytes from dataOffset to encode
dataLen
,
final char[]
the output alphabet (must contain at least 16 chars)
toDigits
,
final char[]
a char[] which will hold the resultant appropriate characters from the alphabet.
out
,
final int
the position within out at which to start writing the encoded characters.
outOffset
)

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.

public static String
encodeHexString(final byte[] bytes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DIGITS_LOWERback to summary
private static final char[] DIGITS_LOWER

Used to build output as hex.

Constructor Detail

Hexback to summary
private Hex()

Method Detail

encodeHexback to summary
private static void encodeHex(final byte[] data, final int dataOffset, final int dataLen, final char[] toDigits, final char[] out, final int outOffset)

Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.

Parameters
data:byte[]

a byte[] to convert to hex characters

dataOffset:int

the position in data to start encoding from

dataLen:int

the number of bytes from dataOffset to encode

toDigits:char[]

the output alphabet (must contain at least 16 chars)

out:char[]

a char[] which will hold the resultant appropriate characters from the alphabet.

outOffset:int

the position within out at which to start writing the encoded characters.

encodeHexStringback to summary
public static String encodeHexString(final byte[] bytes)