Top Description Fields Constructors Methods
org.eclipse.jgit.util

public final Class Hex

extends Object
Class Inheritance
Imports
java.text.MessageFormat, org.eclipse.jgit.internal.JGitText

Encodes and decodes to and from hexadecimal notation.
Since
5.7

Field Summary

Modifier and TypeField and Description
private static final char[]

Constructor Summary

AccessConstructor and Description
private
Hex()

Defeats instantiation.

Method Summary

Modifier and TypeMethod and Description
public static byte[]

Returns:

decoded array
decode
(String
hexadecimal string
s
)

Decode a hexadecimal string to a byte array.

public static String

Returns:

hexadecimal string
toHexString
(byte[]
byte array
b
)

Encode a byte array to a hexadecimal string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

HEXback to summary
private static final char[] HEX

Constructor Detail

Hexback to summary
private Hex()

Defeats instantiation.

Method Detail

decodeback to summary
public static byte[] decode(String s)

Decode a hexadecimal string to a byte array. Note this method validates that characters in the given string are valid as digits in a hex string.

Parameters
s:String

hexadecimal string

Returns:byte[]

decoded array

toHexStringback to summary
public static String toHexString(byte[] b)

Encode a byte array to a hexadecimal string.

Parameters
b:byte[]

byte array

Returns:String

hexadecimal string