|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.Util
public final class Util
Offers static methods for converting data types (which are of general use, but not offered by the java API).
| Constructor Summary | |
|---|---|
private |
Util()
Empty constructor. |
| Method Summary | |
|---|---|
static int |
byteArrayToInt(byte[] byteArray)
Converts the bypassed byte array to an int value. |
static long |
byteArrayToLong(byte[] byteArray)
Converts the bypassed byte array to a long value. |
static int |
byteArrayToShort(byte[] byteArray)
Converts the bypassed byte array to a short value. |
static byte[] |
intToByteArray(int source)
Converts the bypassed int value to a byte array. |
static byte[] |
longToByteArray(long source)
Converts the bypassed long value to a byte array. |
static byte[] |
mergeArrays(byte[] firstArray,
byte[] secondArray)
Merges the bypassed byte arrays ( secondArray is appended to
firstArray). |
static byte[] |
shortToByteArray(int source)
Converts the bypassed short value to a byte array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private Util()
| Method Detail |
|---|
public static byte[] longToByteArray(long source)
source - The long value to be translated.
public static long byteArrayToLong(byte[] byteArray)
byteArray - The byte array to be translated.
public static byte[] intToByteArray(int source)
source - The int value to be translated.
public static int byteArrayToInt(byte[] byteArray)
byteArray - The byte array to be translated.
public static byte[] shortToByteArray(int source)
source - The short value to be translated.
public static int byteArrayToShort(byte[] byteArray)
byteArray - The byte array to be translated.
public static byte[] mergeArrays(byte[] firstArray,
byte[] secondArray)
secondArray is appended to
firstArray).
firstArray - Array to be extended.secondArray - Array to be appended.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||