|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.jpcap.ArrayHelper
public class ArrayHelper
Utility functions for populating and manipulating arrays. Class unchanged but incorporated into clack codebase.
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 |
fillBytes(byte[] byteArray,
long value,
int cnt,
int index)
|
static void |
fillBytesLittleEndian(byte[] byteArray,
long value,
int cnt,
int index)
|
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. |
static byte[] |
toBytesLittleEndian(long value,
int cnt)
Convert a long integer into an array of bytes, little endian format. |
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.public static byte[] toBytesLittleEndian(long value, int cnt)
value
- the long to convert.cnt
- the number of bytes to convert.public static void fillBytes(byte[] byteArray, long value, int cnt, int index)
public static void fillBytesLittleEndian(byte[] byteArray, long value, int cnt, int index)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |