|
MjSip Stack v1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.zoolu.tools.Mangle
Mangle collects some static methods for mangling binary-data structures
| Constructor Summary | |
Mangle()
|
|
| Method Summary | |
static byte[] |
addressToBytes(java.lang.String addr)
Transforms a dotted four-decimals string into a four-bytes array |
static java.lang.String |
bytesToAddress(byte[] b)
Transforms a four-bytes array into a dotted four-decimals string |
static java.lang.String |
bytesToHexString(byte[] b)
Transforms a byte array into a string of hex values |
static java.lang.String |
bytesToHexString(byte[] b,
int len)
Transforms the first len bytes of an array into a string of hex values |
static long |
bytesToInt(byte[] b)
Transforms a 4-bytes array into a 32-bit int |
static long |
bytesToWord(byte[] b)
Transforms a 4-bytes array into a 32-bit word (with the more significative byte at left) |
static long |
bytesToWord(byte[] b,
int offset)
Transforms a 4-bytes array into a 32-bit word (with the more significative byte at left) |
static byte[] |
clone(byte[] b)
Returns a copy of an array of bytes b |
static boolean |
compare(byte[] a,
byte[] b)
Compares two arrays of bytes |
static void |
copyBytes(byte[] src,
byte[] dst,
int offset)
Copies all bytes of array src into array dst with offset offset |
static void |
copyBytes(byte[] src,
byte[] dst,
int offset,
int len)
Copies the first len bytes of array src into array dst with offset offset |
static void |
copyFourBytes(byte[] src,
byte[] dst,
int offset)
Copies a the first 4 bytes of array src into array dst with offset index |
static void |
copyTwoBytes(byte[] src,
byte[] dst,
int offset)
Copies the first 2 bytes of array src into array dst with offset offset |
static byte[] |
fourBytes(byte[] b,
int offset)
Returns a 4-byte array from array b with offset offset |
static byte[] |
getBytes(byte[] b,
int offset,
int len)
Returns a len-byte array from array b with offset offset |
static byte[] |
hexStringToBytes(java.lang.String str)
Transforms a string of hex values into an array of bytes. |
static byte[] |
hexStringToBytes(java.lang.String str,
int len)
Transforms a string of hex values into an array of bytes of max length len. |
static byte[] |
initBytes(byte[] b,
int value)
Initalizes a byte array with value value |
static byte[] |
intToBytes(long n)
Transforms a 32-bit int into a 4-bytes array |
static void |
main(java.lang.String[] args)
|
static byte[] |
twoBytes(byte[] b,
int offset)
Returns a 2-byte array from array b with offset offset |
static short |
uByte(byte b)
Gets the unsigned representatin of a byte (into a short) |
static long |
uWord(int n)
Gets the unsigned representatin of a 32-bit word (into a long) |
static byte[] |
wordToBytes(long n)
Transforms a 32-bit word (with the more significative byte at left) into a 4-bytes array |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Mangle()
| Method Detail |
public static boolean compare(byte[] a,
byte[] b)
public static byte[] initBytes(byte[] b,
int value)
public static short uByte(byte b)
public static long uWord(int n)
public static byte[] clone(byte[] b)
public static byte[] getBytes(byte[] b,
int offset,
int len)
public static byte[] twoBytes(byte[] b,
int offset)
public static byte[] fourBytes(byte[] b,
int offset)
public static void copyBytes(byte[] src,
byte[] dst,
int offset)
public static void copyBytes(byte[] src,
byte[] dst,
int offset,
int len)
public static void copyTwoBytes(byte[] src,
byte[] dst,
int offset)
public static void copyFourBytes(byte[] src,
byte[] dst,
int offset)
public static java.lang.String bytesToHexString(byte[] b,
int len)
public static java.lang.String bytesToHexString(byte[] b)
public static byte[] hexStringToBytes(java.lang.String str,
int len)
public static byte[] hexStringToBytes(java.lang.String str)
public static java.lang.String bytesToAddress(byte[] b)
public static byte[] addressToBytes(java.lang.String addr)
public static long bytesToInt(byte[] b)
public static byte[] intToBytes(long n)
public static long bytesToWord(byte[] b,
int offset)
public static long bytesToWord(byte[] b)
public static byte[] wordToBytes(long n)
public static void main(java.lang.String[] args)
|
MjSip Stack v1.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||