|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectoemware.core.util.ByteNumberUtils
public class ByteNumberUtils
The byte number utils. Most of these came from the Sun DNS classes. They were modified to work with our needs. The Java SDK source is released under GPL. You can download the Sun JDK source from http://java.sun.com.
| Constructor Summary | |
|---|---|
ByteNumberUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
createInt(int value)
Returns a new byte array with the passed value. |
static byte[] |
createIntB(int value)
Returns a new byte array (big endian) with the value. |
static byte[] |
createUInt(long value)
Returns a new byte array with the passed value. |
static int |
getInt(byte[] data,
int pos)
Returns the 4-byte signed value at msg[pos]. |
static long |
getLongL(byte[] data,
int pos)
Returns the eight byte long (little endian). |
static int |
getUByte(byte[] data,
int pos)
Returns the 1-byte unsigned value at msg[pos]. |
static int |
getUInt(byte pValue)
Returns an unsigned int for the byte passed. |
static long |
getUInt(byte[] data,
int pos)
Returns the 4-byte unsigned value at msg[pos]. |
static int |
getUShort(byte[] data,
int pos)
Returns the 2-byte unsigned value at msg[pos]. |
static char |
getUShortChar(byte[] data,
int pos)
Returns the 2-byte unsigned char at the pos. |
static void |
setIntB(byte[] data,
int pos,
int value)
Set a int value in a byte array (big endian). |
static void |
setLongL(byte[] data,
int pos,
long value)
Set the 8-byte long (little endian). |
static void |
setUInt(byte[] data,
int pos,
long value)
Set the 4-byte unsigned short at the position. |
static void |
setUShort(byte[] data,
int pos,
int value)
Set the 2-byte unsigned short at the position. |
static void |
setUShortChar(byte[] data,
int pos,
char value)
Set the 2-byte unsigned short at the position. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteNumberUtils()
| Method Detail |
|---|
public static final int getUShort(byte[] data,
int pos)
public static final char getUShortChar(byte[] data,
int pos)
public static final void setUShort(byte[] data,
int pos,
int value)
public static final void setUShortChar(byte[] data,
int pos,
char value)
public static final int getUInt(byte pValue)
pValue - The byte.
public static final byte[] createIntB(int value)
value - The int to convert.public static final byte[] createInt(int value)
public static final byte[] createUInt(long value)
public static final int getUByte(byte[] data,
int pos)
public static final void setUInt(byte[] data,
int pos,
long value)
public static final int getInt(byte[] data,
int pos)
public static void setIntB(byte[] data,
int pos,
int value)
data - The value.pos - The position.value - The value.
public static final long getUInt(byte[] data,
int pos)
public static final void setLongL(byte[] data,
int pos,
long value)
public static final long getLongL(byte[] data,
int pos)
data - The place to read from.pos - The position in the data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||