|
Knopflerfish OSGi 2.4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knopflerfish.util.ByteArray
A converter class used to read primitive datatypes from, or write them to, a bytearray, starting at position index. The data is stored as big-endian in the array (the most significant value in the sequence is stored first at the lowest storage address).
Constructor Summary | |
ByteArray()
|
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ByteArray()
Method Detail |
public static byte getByte(byte[] array, int index)
array
- the bytearray to read fromindex
- the index to start at in the bytearray
public static short getShort(byte[] array, int index)
array
- the bytearray to read fromindex
- the index to start at in the bytearray
public static int getInt(byte[] array, int index)
array
- the bytearray to read fromindex
- the index to start at in the bytearray
public static float getFloat(byte[] array, int index)
array
- the bytearray to read fromindex
- the index to start at in the bytearray
public static long getLong(byte[] array, int index)
array
- the bytearray to read fromindex
- the index to start at in the bytearray
public 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 bytearray
public 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 bytearray
public 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 bytearray
public 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 bytearray
public static int setDouble(double d, byte[] array, int index)
|
Knopflerfish OSGi 2.4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |