Package org.eclipse.net4j.util
Klasse HexUtil
java.lang.Object
org.eclipse.net4j.util.HexUtil
Provides static methods that convert to and from hexadecimal string formats.
- Autor:
- Eike Stepper
-
Feldübersicht
Felder -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic void
appendHex
(StringBuilder builder, int b) Veraltet.static String
bytesToHex
(byte[] bs) static String
bytesToHex
(byte[] bs, int off, int length) Converts a byte array into a string of lower case hex chars.static void
bytesToHex
(InputStream bs, Writer writer) static void
bytesToHexAppend
(byte[] bs, int off, int length, Appendable appendable) static String
charToHex
(char ch) static String
formatByte
(int b) Veraltet.static String
formatBytes
(byte[] bytes) Veraltet.static void
hexToBytes
(Reader s, OutputStream outputStream) static byte[]
hexToBytes
(String s) static void
hexToBytes
(String s, byte[] out, int off) Converts a String of hex characters into an array of bytes.static byte[]
hexToBytes
(String s, int off) static char
static String
identityHashCode
(Object object) static String
identityHashCode
(Object object, boolean trimLeadingZeros) static String
intToHex
(int v) static String
longToHex
(long v)
-
Felddetails
-
DIGITS
public static final char[] DIGITS
-
-
Methodendetails
-
charToHex
- Seit:
- 3.22
-
hexToChar
- Seit:
- 3.22
-
bytesToHex
Converts a byte array into a string of lower case hex chars.- Parameter:
bs
- A byte arrayoff
- The index of the first byte to readlength
- The number of bytes to read.- Gibt zurück:
- the string of hex chars.
-
bytesToHexAppend
-
bytesToHex
- Seit:
- 3.7
-
bytesToHex
-
hexToBytes
-
hexToBytes
-
hexToBytes
public static void hexToBytes(String s, byte[] out, int off) throws NumberFormatException, IndexOutOfBoundsException Converts a String of hex characters into an array of bytes.- Parameter:
s
- A string of hex characters (upper case or lower) of even length.out
- A byte array of length at least s.length()/2 + offoff
- The first byte to write of the array- Löst aus:
NumberFormatException
IndexOutOfBoundsException
-
hexToBytes
- Löst aus:
NumberFormatException
- Seit:
- 3.7
-
longToHex
-
intToHex
- Seit:
- 3.13
-
identityHashCode
- Seit:
- 3.13
-
identityHashCode
- Seit:
- 3.20
-
formatByte
Veraltet. -
formatBytes
Veraltet. -
appendHex
Veraltet.
-