com.ricebridge.util
Class RBDataUtil

java.lang.Object
  extended bycom.ricebridge.util.RBDataUtil

public class RBDataUtil
extends Object

Contracts: AssumesValidArgs,RuntimeExceptions


Field Summary
static int BYTE_SIZE
           
static String[] HEX
           
static int NYBBLE_SIZE
           
 
Constructor Summary
RBDataUtil()
           
 
Method Summary
static String byte2bits(byte pByte)
           
static String byte2hex(byte pByte)
           
static String bytes2hex(byte[] pBytes)
           
static String formatByteSizeUp(long pByteSize)
          return size formatted as 0.1Kb, 2Kb, 3.1Mb, estimating upwards
static byte[] hex2bytes(String pHex)
           
static int hex2int(char pHex)
           
static byte[] int2bytes(int pInt)
           
static String int2hex(int pInt)
           
static String md5HexHash(String pText)
          Get an MD5 hash of a String as a hex String
static byte[] xor(byte[] pSource, byte[] pKey)
          return byte[pSource.length] xoring each byte against corresponding pKey byte, repeating pKey as needed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NYBBLE_SIZE

public static final int NYBBLE_SIZE
See Also:
Constant Field Values

BYTE_SIZE

public static final int BYTE_SIZE
See Also:
Constant Field Values

HEX

public static final String[] HEX
Constructor Detail

RBDataUtil

public RBDataUtil()
Method Detail

md5HexHash

public static String md5HexHash(String pText)
Get an MD5 hash of a String as a hex String


int2hex

public static final String int2hex(int pInt)

int2bytes

public static final byte[] int2bytes(int pInt)

bytes2hex

public static final String bytes2hex(byte[] pBytes)

byte2hex

public static final String byte2hex(byte pByte)

hex2bytes

public static final byte[] hex2bytes(String pHex)

hex2int

public static final int hex2int(char pHex)

byte2bits

public static final String byte2bits(byte pByte)

xor

public static final byte[] xor(byte[] pSource,
                               byte[] pKey)
return byte[pSource.length] xoring each byte against corresponding pKey byte, repeating pKey as needed


formatByteSizeUp

public static final String formatByteSizeUp(long pByteSize)
return size formatted as 0.1Kb, 2Kb, 3.1Mb, estimating upwards



Copyright © 2003-2006 Ricebridge