org.jsmpp.util
Class HexUtil

java.lang.Object
  extended by org.jsmpp.util.HexUtil

public class HexUtil
extends java.lang.Object

The Hex utility.

Since:
1.0
Version:
1.0
Author:
uudashr

Field Summary
private static char[] hexChar
           
 
Constructor Summary
HexUtil()
           
 
Method Summary
static java.lang.String conventBytesToHexString(byte[] data)
          Convert bytes to hex string.
static java.lang.String convertBytesToHexString(byte[] data, int offset, int length)
          Convert bytes to hex string value (using Big-Endian rule).
static java.lang.String convertBytesToHexString(byte[] data, int offset, int length, java.lang.String byteDelimiter)
           
static byte[] convertHexStringToBytes(java.lang.String hexString)
          Convert the hex string to bytes.
static byte[] convertHexStringToBytes(java.lang.String hexString, int offset, int endIndex)
          Convert the hex string to bytes.
static java.lang.String convertHexStringToString(java.lang.String hexString)
          Convert the hex string to string.
static java.lang.String convertStringToHexString(java.lang.String data)
          Convert the string to hex string value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hexChar

private static final char[] hexChar
Constructor Detail

HexUtil

public HexUtil()
Method Detail

convertStringToHexString

public static java.lang.String convertStringToHexString(java.lang.String data)
Convert the string to hex string value.

Parameters:
data - is case sensitive.
Returns:
the hex string representation of string.

conventBytesToHexString

public static java.lang.String conventBytesToHexString(byte[] data)
Convert bytes to hex string.

Parameters:
data - is the bytes.
Returns:
the hex string representation of bytes.

convertBytesToHexString

public static java.lang.String convertBytesToHexString(byte[] data,
                                                       int offset,
                                                       int length)
Convert bytes to hex string value (using Big-Endian rule).

Parameters:
data - is the bytes.
offset - is the offset.
length - is the length.
Returns:
the hex string representation of bytes.

convertBytesToHexString

public static java.lang.String convertBytesToHexString(byte[] data,
                                                       int offset,
                                                       int length,
                                                       java.lang.String byteDelimiter)

convertHexStringToString

public static java.lang.String convertHexStringToString(java.lang.String hexString)
Convert the hex string to string.

Parameters:
hexString - is the hex string.
Returns:
the string value that converted from hex string.

convertHexStringToBytes

public static byte[] convertHexStringToBytes(java.lang.String hexString)
Convert the hex string to bytes.

Parameters:
hexString - is the hex string.
Returns:
the bytes value that converted from the hex string.

convertHexStringToBytes

public static byte[] convertHexStringToBytes(java.lang.String hexString,
                                             int offset,
                                             int endIndex)
Convert the hex string to bytes.

Parameters:
hexString - is the hex string.
offset - is the offset.
endIndex - is the end index.
Returns:
the bytes value that converted from the hex string.