issrg.SAWS
Class utility

java.lang.Object
  extended by issrg.SAWS.utility

public class utility
extends java.lang.Object


Constructor Summary
utility()
           
 
Method Summary
static java.lang.String byte2hex(byte b)
           
static void byte2hex(byte b, java.lang.StringBuffer buf)
           
static int byteArrayToInt(byte[] b)
          Convert the byte array to an int.
static int byteArrayToInt(byte[] b, int offset)
          Convert the byte array to an int starting from the given offset.
static long byteArrayToLong(byte[] b)
           
static long byteArrayToLong(byte[] b, int offset)
          Convert the byte array to a long starting from the given offset.
static int byteToInt(byte b)
           
static byte intToByte(int value)
           
static byte[] intToByteArray(int value)
           
static byte[] longToByteArray(long value)
           
static java.lang.String toHexString(byte[] block)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

utility

public utility()
Method Detail

intToByte

public static byte intToByte(int value)

byteToInt

public static int byteToInt(byte b)

longToByteArray

public static byte[] longToByteArray(long value)

byteArrayToLong

public static long byteArrayToLong(byte[] b)

byteArrayToLong

public static long byteArrayToLong(byte[] b,
                                   int offset)
Convert the byte array to a long starting from the given offset.

Parameters:
b - The byte array
offset - The array offset
Returns:
The long

intToByteArray

public static byte[] intToByteArray(int value)

byteArrayToInt

public static int byteArrayToInt(byte[] b)
Convert the byte array to an int.

Parameters:
b - The byte array
Returns:
The integer

byteArrayToInt

public static int byteArrayToInt(byte[] b,
                                 int offset)
Convert the byte array to an int starting from the given offset.

Parameters:
b - The byte array, b[0] is the highest digit
offset - The array offset
Returns:
The integer

byte2hex

public static java.lang.String byte2hex(byte b)

byte2hex

public static void byte2hex(byte b,
                            java.lang.StringBuffer buf)

toHexString

public static java.lang.String toHexString(byte[] block)