|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jpcap.util.ArrayHelper
Utility functions for populating and manipulating arrays.
Constructor Summary | |
ArrayHelper()
|
Method Summary | |
static int |
extractInteger(byte[] bytes,
int pos,
int cnt)
Extract an integer from a byte array. |
static long |
extractLong(byte[] bytes,
int pos,
int cnt)
Extract a long from a byte array. |
static void |
insertLong(byte[] bytes,
long value,
int pos,
int cnt)
Insert data contained in a long integer into an array. |
static byte[] |
join(byte[] a,
byte[] b)
Join two arrays. |
static byte[] |
toBytes(long value,
int cnt)
Convert a long integer into an array of bytes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayHelper()
Method Detail |
public static byte[] join(byte[] a, byte[] b)
public static long extractLong(byte[] bytes, int pos, int cnt)
bytes
- an array.pos
- the starting position where the integer is stored.cnt
- the number of bytes which contain the integer.
public static int extractInteger(byte[] bytes, int pos, int cnt)
bytes
- an array.pos
- the starting position where the integer is stored.cnt
- the number of bytes which contain the integer.
public static void insertLong(byte[] bytes, long value, int pos, int cnt)
bytes
- an array.value
- the long to insert into the array.pos
- the starting position into which the long is inserted.cnt
- the number of bytes to insert.public static byte[] toBytes(long value, int cnt)
value
- the long to convert.cnt
- the number of bytes to convert.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |