|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.cunit.util.Types
public class Types
Type conversions.
| Constructor Summary | |
|---|---|
Types()
|
|
| Method Summary | |
|---|---|
static byte[] |
bytesFromInt(int i)
Construct an array of four individual bytes from an int. |
static void |
bytesFromInt(int i,
byte[] b,
int start)
Construct four individual bytes from an int and place them in the byte array starting at offset start. |
static byte[] |
bytesFromShort(short s)
Construct an array of two individual bytes from a short. |
static void |
bytesFromShort(short s,
byte[] b,
int start)
Construct two individual bytes from a short and place them in the byte array at offset start. |
static int |
intFromBytes(byte[] b,
int start)
Construct an int from four bytes in a byte array. |
static short |
shortFromBytes(byte[] b,
int start)
Construct a short from two bytes in a byte array. |
static int |
uintFromBytes(byte[] b,
int start)
Construct an int from four bytes in a byte array. |
static int |
unsigned(byte b)
Convert a signed byte into an unsigned byte. |
static long |
unsigned(int i)
Convert a signed int into an unsigned integer. |
static int |
unsigned(short s)
Convert a signed short into an unsigned short. |
static int |
ushortFromBytes(byte[] b,
int start)
Construct a short from two bytes in a byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Types()
| Method Detail |
|---|
public static final long unsigned(int i)
i - signed int
public static final int unsigned(short s)
s - signed short
public static final int unsigned(byte b)
b - signed byte
public static final int ushortFromBytes(byte[] b,
int start)
b - byte arraystart - index in byte array
public static final short shortFromBytes(byte[] b,
int start)
b - byte arraystart - index in byte array
public static final byte[] bytesFromShort(short s)
s - short
public static final void bytesFromShort(short s,
byte[] b,
int start)
s - shortb - byte arraystart - offset
public static final int uintFromBytes(byte[] b,
int start)
b - byte arraystart - index in byte array
public static final int intFromBytes(byte[] b,
int start)
b - byte arraystart - index in byte array
public static final byte[] bytesFromInt(int i)
i - int
public static final void bytesFromInt(int i,
byte[] b,
int start)
i - intb - byte arraystart - offset
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||