|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmx.udlap.kjProtocol.tools.DataTypesTools
Class containing method tools to handle byte arrays, numbers, etcetera...
| Constructor Summary | |
DataTypesTools()
|
|
| Method Summary | |
static byte[] |
append(byte[] dst,
byte[] src)
Appends contents of src to dst and returns a third byte[] |
static byte[] |
byteCat(byte[] src,
byte[] dst)
Concatenates two byte arays |
static byte[] |
byteSubstring(int start,
int end,
byte[] src)
Extracts bytes from start index to end index of source byte array |
static java.lang.String |
byteToHex(byte num)
Converts a byte to its corresponding String in Hex representation |
static java.lang.String |
byteToHex(byte[] nums)
Converts a byte array to its corresponding String in Hex representation |
static java.lang.String |
byteToURLHex(byte num)
Converts a byte to its corresponding String in Hex representation scaped for usage as URL encoding |
static java.lang.String |
byteToURLHex(byte[] nums)
Converts a byte array to its corresponding String in Hex representation scaped for usage as URL encoding |
static java.lang.String |
hexDump(byte[] data)
Converts a byte array string into a hex editor representation |
static byte[] |
hexStringToBytes(java.lang.String data)
Parses a string of Hex values into a byte array with the equivalent numbers. For example: |
static KInteger |
parseKIntFromByteArray(byte[] src,
int position)
Takes bytes from array to map them into a KInteger |
static KString |
parseKStringFromByteArray(byte[] src,
int position)
Takes bytes from array to map them into a KString |
static KTime |
parseKTimeFromByteArray(byte[] src,
int position)
Description of the Method |
static KUUID |
parseKUUIDFromByteArray(byte[] src,
int position)
Description of the Method |
static byte |
randomByte()
Returns a random number between 0 and 255 |
static short |
signed2unsignedShort(byte signed)
Converts a signed byte number into a unsigned Short |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DataTypesTools()
| Method Detail |
public static short signed2unsignedShort(byte signed)
signed - Signed byte
public static byte[] append(byte[] dst,
byte[] src)
dst - Destination byte arraysrc - Source Byte array
public static byte[] byteSubstring(int start,
int end,
byte[] src)
start - Starting positionend - Ending positionsrc - Source byte array
public static byte[] byteCat(byte[] src,
byte[] dst)
src - Source byte arraydst - Destination byte array
public static java.lang.String byteToHex(byte num)
num - Byte number
public static java.lang.String byteToHex(byte[] nums)
nums - Byte array
public static java.lang.String byteToURLHex(byte num)
num - Byte number
public static java.lang.String byteToURLHex(byte[] nums)
nums - Description of the Parameter
public static byte randomByte()
public static byte[] hexStringToBytes(java.lang.String data)
throws NotAnHexStringException
A sring like : "1110DEAB"
Would be : byte[] return = {17, 16, 222, 171}
data - A string of the form: [0-9A-Fa-f]+
NotAnHexStringException - If data is not the form specified above.
public static KInteger parseKIntFromByteArray(byte[] src,
int position)
src - Source byte arrayposition - First Byte in array to map
public static KTime parseKTimeFromByteArray(byte[] src,
int position)
src - Description of the Parameterposition - Description of the Parameter
public static KUUID parseKUUIDFromByteArray(byte[] src,
int position)
src - Description of the Parameterposition - Description of the Parameter
public static KString parseKStringFromByteArray(byte[] src,
int position)
src - Source byte arrayposition - First Byte in array to map
public static java.lang.String hexDump(byte[] data)
data - byte array
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||