org.eclipse.net4j.util
Class HexUtil

java.lang.Object
  extended by org.eclipse.net4j.util.HexUtil

public final class HexUtil
extends java.lang.Object


Field Summary
static char[] DIGITS
           
 
Method Summary
static void appendHex(java.lang.StringBuilder builder, int b)
          Deprecated. 
static java.lang.String bytesToHex(byte[] bs)
           
static java.lang.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, java.lang.Appendable appendable)
           
static java.lang.String formatByte(int b)
          Deprecated. 
static java.lang.String formatBytes(byte[] bytes)
          Deprecated. 
static byte[] hexToBytes(java.lang.String s)
           
static void hexToBytes(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.String longToHex(long v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIGITS

public static final char[] DIGITS
Method Detail

bytesToHex

public static final 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.

bytesToHexAppend

public static final void bytesToHexAppend(byte[] bs,
                                          int off,
                                          int length,
                                          java.lang.Appendable appendable)

bytesToHex

public static final java.lang.String bytesToHex(byte[] bs)

hexToBytes

public static final byte[] hexToBytes(java.lang.String s)

hexToBytes

public static final byte[] hexToBytes(java.lang.String s,
                                      int off)

hexToBytes

public static final void hexToBytes(java.lang.String s,
                                    byte[] out,
                                    int off)
                             throws java.lang.NumberFormatException,
                                    java.lang.IndexOutOfBoundsException
Converts 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

longToHex

public static java.lang.String longToHex(long v)

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. 


Copyright (c) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.