org.knopflerfish.util
public class ByteArray extends java.lang.Object
| Constructor and Description |
|---|
ByteArray() |
| Modifier and Type | Method and Description |
|---|---|
static byte |
getByte(byte[] array,
int index)
Returns a byte read from the bytearray, starting at position index.
|
static double |
getDouble(byte[] array,
int index) |
static float |
getFloat(byte[] array,
int index)
Returns a float read from the bytearray, starting at the position index.
|
static int |
getInt(byte[] array,
int index)
Returns an integer read from the bytearray, starting at position index.
|
static long |
getLong(byte[] array,
int index)
Returns a long read from the bytearray, starting at position index.
|
static short |
getShort(byte[] array,
int index)
Returns a short read from the bytearray, starting at position index.
|
static int |
setByte(byte b,
byte[] array,
int index)
Writes a byte into the bytearray, starting at position index.
|
static int |
setDouble(double d,
byte[] array,
int index) |
static int |
setFloat(float f,
byte[] array,
int index) |
static int |
setInt(int i,
byte[] array,
int index)
Writes an integer into the bytearray, starting at position index.
|
static int |
setLong(long l,
byte[] array,
int index)
Writes a long into the bytearray, starting at position index.
|
static int |
setShort(short s,
byte[] array,
int index)
Writes a short into the bytearray, starting at position index.
|
public static byte getByte(byte[] array,
int index)
array - the bytearray to read fromindex - the index to start at in the bytearraypublic static short getShort(byte[] array,
int index)
array - the bytearray to read fromindex - the index to start at in the bytearraypublic static int getInt(byte[] array,
int index)
array - the bytearray to read fromindex - the index to start at in the bytearraypublic static float getFloat(byte[] array,
int index)
array - the bytearray to read fromindex - the index to start at in the bytearraypublic static long getLong(byte[] array,
int index)
array - the bytearray to read fromindex - the index to start at in the bytearraypublic static double getDouble(byte[] array,
int index)
public static int setByte(byte b,
byte[] array,
int index)
b - the byte to write downarray - the bytearray to write toindex - the index to start at in the bytearraypublic static int setShort(short s,
byte[] array,
int index)
s - the short to write downarray - the bytearray to write toindex - the index to start at in the bytearraypublic static int setInt(int i,
byte[] array,
int index)
i - the integer to write downarray - the bytearray to write toindex - the index to start at in the bytearraypublic static int setFloat(float f,
byte[] array,
int index)
public static int setLong(long l,
byte[] array,
int index)
l - the long to write downarray - the bytearray to write toindex - the index to start at in the bytearraypublic static int setDouble(double d,
byte[] array,
int index)