net.sf.mmapps.commons.util
Class HexUtil

java.lang.Object
  extended by net.sf.mmapps.commons.util.HexUtil

public class HexUtil
extends java.lang.Object


Constructor Summary
HexUtil()
           
 
Method Summary
static byte[] toByteArray(java.lang.String hexString)
          Converts a string of hex digits into a byte array of those digits
static byte[] toByteArray(java.lang.String hexString, java.lang.String separators)
          Converts a string of hex digits into a byte array of those digits
static java.lang.String toHex(byte b)
          Convert byte to Hex String
static java.lang.String toHex(byte[] b)
          Convert byte array to Hex String
static java.lang.String toHex(byte[] b, int off, int len)
          Convert byte array to Hex String
static java.lang.String toHex(int i)
          Convert int to Hex String
static java.lang.String toHex(int[] b)
          Convert int array to Hex String
static java.lang.String toHex(int[] b, int off, int len)
          Convert int array to Hex String
static java.lang.String toHex(short i)
          Convert short to Hex String
static java.lang.String toHex(short[] b)
          Convert short array to Hex String
static java.lang.String toHex(short[] b, int off, int len)
          Convert short array to Hex String
static java.lang.String toHexFormat(byte[] b)
          Convert byte array to Hex format String
static java.lang.String toHexFormat(byte[] b, int off, int len)
          Convert byte array to Hex format String
static java.lang.String toHexFormat(int[] b)
          Convert int array to Hex format String
static java.lang.String toHexFormat(int[] b, int off, int len)
          Convert int array to Hex format String
static java.lang.String toHexFormat(short[] b)
          Convert short array to Hex format String
static java.lang.String toHexFormat(short[] b, int off, int len)
          Convert short array to Hex format String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexUtil

public HexUtil()
Method Detail

toByteArray

public static byte[] toByteArray(java.lang.String hexString)
Converts a string of hex digits into a byte array of those digits

Parameters:
hexString - A String with ascii hex digits
Returns:
byte[]

toByteArray

public static byte[] toByteArray(java.lang.String hexString,
                                 java.lang.String separators)
Converts a string of hex digits into a byte array of those digits

Parameters:
hexString - A String with ascii hex digits
separators - A String containing the separator characters
Returns:
byte[]

toHex

public static java.lang.String toHex(int i)
Convert int to Hex String

Parameters:
i - value to convert
Returns:
String

toHex

public static java.lang.String toHex(short i)
Convert short to Hex String

Parameters:
i - value to convert
Returns:
String

toHex

public static java.lang.String toHex(byte b)
Convert byte to Hex String

Parameters:
b - value to convert
Returns:
String

toHex

public static java.lang.String toHex(byte[] b)
Convert byte array to Hex String

Parameters:
b - value to convert
Returns:
String

toHex

public static java.lang.String toHex(short[] b)
Convert short array to Hex String

Parameters:
b - value to convert
Returns:
String

toHex

public static java.lang.String toHex(int[] b)
Convert int array to Hex String

Parameters:
b - value to convert
Returns:
String

toHex

public static java.lang.String toHex(int[] b,
                                     int off,
                                     int len)
Convert int array to Hex String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String

toHex

public static java.lang.String toHex(short[] b,
                                     int off,
                                     int len)
Convert short array to Hex String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String

toHex

public static java.lang.String toHex(byte[] b,
                                     int off,
                                     int len)
Convert byte array to Hex String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(int[] b)
Convert int array to Hex format String

Parameters:
b - value to convert
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(short[] b)
Convert short array to Hex format String

Parameters:
b - value to convert
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(byte[] b)
Convert byte array to Hex format String

Parameters:
b - value to convert
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(byte[] b,
                                           int off,
                                           int len)
Convert byte array to Hex format String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(short[] b,
                                           int off,
                                           int len)
Convert short array to Hex format String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String

toHexFormat

public static java.lang.String toHexFormat(int[] b,
                                           int off,
                                           int len)
Convert int array to Hex format String

Parameters:
b - value to convert
off - offset
len - length
Returns:
String


Copyright © 2003-2006 mmapps. All Rights Reserved.