|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.net4j.util.HexUtil
Provides static methods that convert to and from hexadecimal string formats.
Field Summary | |
---|---|
static char[] |
DIGITS
|
Method Summary | |
---|---|
static void |
appendHex(StringBuilder builder,
int b)
Deprecated. |
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 |
bytesToHexAppend(byte[] bs,
int off,
int length,
Appendable appendable)
|
static String |
formatByte(int b)
Deprecated. |
static String |
formatBytes(byte[] bytes)
Deprecated. |
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 String |
longToHex(long v)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char[] DIGITS
Method Detail |
---|
public static String bytesToHex(byte[] bs, int off, int length)
bs
- A byte arrayoff
- The index of the first byte to readlength
- The number of bytes to read.
public static void bytesToHexAppend(byte[] bs, int off, int length, Appendable appendable)
public static String bytesToHex(byte[] bs)
public static byte[] hexToBytes(String s)
public static byte[] hexToBytes(String s, int off)
public static void hexToBytes(String s, byte[] out, int off) throws NumberFormatException, IndexOutOfBoundsException
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
NumberFormatException
IndexOutOfBoundsException
public static String longToHex(long v)
@Deprecated public static String formatByte(int b)
@Deprecated public static String formatBytes(byte[] bytes)
@Deprecated public static void appendHex(StringBuilder builder, int b)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |