Package org.eclipse.net4j.util
Class HexUtil
- java.lang.Object
- 
- org.eclipse.net4j.util.HexUtil
 
- 
 public final class HexUtil extends java.lang.ObjectProvides static methods that convert to and from hexadecimal string formats.- Author:
- Eike Stepper
 
- 
- 
Field SummaryFields Modifier and Type Field Description static char[]DIGITS
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidappendHex(java.lang.StringBuilder builder, int b)Deprecated.static java.lang.StringbytesToHex(byte[] bs)static java.lang.StringbytesToHex(byte[] bs, int off, int length)Converts a byte array into a string of lower case hex chars.static voidbytesToHex(java.io.InputStream bs, java.io.Writer writer)static voidbytesToHexAppend(byte[] bs, int off, int length, java.lang.Appendable appendable)static java.lang.StringformatByte(int b)Deprecated.static java.lang.StringformatBytes(byte[] bytes)Deprecated.static voidhexToBytes(java.io.Reader s, java.io.OutputStream outputStream)static byte[]hexToBytes(java.lang.String s)static voidhexToBytes(java.lang.String s, byte[] out, int off)Converts a String of hex characters into an array of bytes.static byte[]hexToBytes(java.lang.String s, int off)static java.lang.StringidentityHashCode(java.lang.Object object)static java.lang.StringintToHex(int v)static java.lang.StringlongToHex(long v)
 
- 
- 
- 
Method Detail- 
bytesToHexpublic static java.lang.String bytesToHex(byte[] bs, int off, int length)Converts a byte array into a string of lower case hex chars.- Parameters:
- bs- A byte array
- off- The index of the first byte to read
- length- The number of bytes to read.
- Returns:
- the string of hex chars.
 
 - 
bytesToHexAppendpublic static void bytesToHexAppend(byte[] bs, int off, int length, java.lang.Appendable appendable)
 - 
bytesToHexpublic static void bytesToHex(java.io.InputStream bs, java.io.Writer writer)- Since:
- 3.7
 
 - 
bytesToHexpublic static java.lang.String bytesToHex(byte[] bs) 
 - 
hexToBytespublic static byte[] hexToBytes(java.lang.String s) 
 - 
hexToBytespublic static byte[] hexToBytes(java.lang.String s, int off)
 - 
hexToBytespublic static void hexToBytes(java.lang.String s, byte[] out, int off) throws java.lang.NumberFormatException, java.lang.IndexOutOfBoundsExceptionConverts a String of hex characters into an array of bytes.- Parameters:
- s- A string of hex characters (upper case or lower) of even length.
- out- A byte array of length at least s.length()/2 + off
- off- The first byte to write of the array
- Throws:
- java.lang.NumberFormatException
- java.lang.IndexOutOfBoundsException
 
 - 
hexToBytespublic static void hexToBytes(java.io.Reader s, java.io.OutputStream outputStream) throws java.lang.NumberFormatException- Throws:
- java.lang.NumberFormatException
- Since:
- 3.7
 
 - 
longToHexpublic static java.lang.String longToHex(long v) 
 - 
intToHexpublic static java.lang.String intToHex(int v) - Since:
- 3.13
 
 - 
identityHashCodepublic static java.lang.String identityHashCode(java.lang.Object object) - Since:
- 3.13
 
 - 
formatByte@Deprecated public static java.lang.String formatByte(int b) Deprecated.
 - 
formatBytes@Deprecated public static java.lang.String formatBytes(byte[] bytes) Deprecated.
 - 
appendHex@Deprecated public static void appendHex(java.lang.StringBuilder builder, int b)Deprecated.
 
- 
 
-