|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.exist.util.ByteConversion
public class ByteConversion
A collection of static methods to write integer values from/to a byte array.
| Constructor Summary | |
|---|---|
ByteConversion()
|
|
| Method Summary | |
|---|---|
static int |
byteToInt(byte[] data,
int start)
Read an integer value from the specified byte array, starting at start. |
static long |
byteToLong(byte[] data,
int start)
Read a long value from the specified byte array, starting at start. |
static short |
byteToShort(byte[] data,
int start)
Read a short value from the specified byte array, starting at start. |
static byte[] |
intToByte(int v,
byte[] data,
int start)
Write an int value to the specified byte array. |
static byte[] |
longToByte(long v)
Write an int value to a newly allocated byte array. |
static byte[] |
longToByte(long v,
byte[] data,
int start)
Write a long value to the specified byte array. |
static byte[] |
shortToByte(short v)
Write a short value to a newly allocated byte array. |
static byte[] |
shortToByte(short v,
byte[] data,
int start)
Write a short value to the specified byte array. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteConversion()
| Method Detail |
|---|
public static final int byteToInt(byte[] data,
int start)
public static final long byteToLong(byte[] data,
int start)
public static final short byteToShort(byte[] data,
int start)
public static final byte[] intToByte(int v,
byte[] data,
int start)
v - the valuedata - the byte array to write intostart - the offset
public static final byte[] longToByte(long v,
byte[] data,
int start)
v - the valuedata - the byte array to write intostart - the offset
public static final byte[] longToByte(long v)
v - the value
public static final byte[] shortToByte(short v,
byte[] data,
int start)
v - the valuedata - the byte array to write intostart - the offset
public static final byte[] shortToByte(short v)
v - the value
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||