|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.runtime.Pickle
final class Pickle
Support for pickling and unpickling common data objects.
| Constructor Summary | |
|---|---|
Pickle()
|
|
| Method Summary | |
|---|---|
static java.net.InetAddress |
arrayToInetAddress(byte[] b,
int offset)
Reconstruct Internet address from bytes. |
static int |
arrayToInteger(byte[] b,
int offset)
Reconstruct integer from bytes. |
static java.lang.Object |
arrayToObject(byte[] b)
Reconstruct object from bytes. |
static java.lang.Object |
arrayToObject(byte[] b,
int offset)
Reconstruct object from bytes. |
static short |
arrayToShort(byte[] b,
int offset)
Reconstruct short from bytes. |
static java.lang.String |
arrayToString(byte[] b,
int offset)
Reconstruct string from bytes. |
static int[] |
byteToIntArray(byte[] data)
Convert unsigned bytes to ints. |
static int[] |
byteToIntArray(byte[] data,
int offset,
int length)
Convert unsigned bytes to ints. |
static byte[] |
concat(byte[] b1,
byte[] b2)
Concatenate two byte arrays. |
static java.util.Vector |
Enum2Vector(java.util.Enumeration e)
Utility method to stuff an entire enumeration into a vector. |
static void |
InetAddressToArray(java.net.InetAddress inet,
byte[] b,
int offset)
Store Internet address as bytes. |
static void |
integerToArray(int integer,
byte[] b,
int offset)
Store integer as bytes. |
static byte[] |
intToByteArray(int[] data)
Convert ints into unsigned bytes. |
static byte[] |
intToByteArray(int[] data,
int offset,
int length)
Convert ints into unsigned bytes. |
static byte[] |
objectToArray(java.lang.Object s)
Store object as bytes. |
static void |
printByteArrayNicely(byte[] a)
Print a hex-dump of a byte-array to System standard output stream. |
static void |
printByteArrayNicely(byte[] a,
int offset,
int length)
Print a hex-dump of some portion of a byte-array to System standard output stream. |
static void |
printlnByteArrayNicely(byte[] a)
Print a hex-dump of a byte-array to System.out followed by a new line. |
static void |
printlnByteArrayNicely(byte[] a,
int offset,
int length)
Print a hex-dump of some portion of a byte-array to System.out followed by a new line. |
static void |
shortToArray(short i,
byte[] b,
int offset)
Store integer as bytes. |
static byte[] |
stringToArray(java.lang.String s)
Store string as bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
Pickle()
| Method Detail |
|---|
public static void printByteArrayNicely(byte[] a)
a - array to print
public static void printByteArrayNicely(byte[] a,
int offset,
int length)
a - array to printoffset - starting offsetlength - number of bytes of printpublic static void printlnByteArrayNicely(byte[] a)
a - array to print
public static void printlnByteArrayNicely(byte[] a,
int offset,
int length)
a - array to printoffset - starting offsetlength - number of bytes of printpublic static java.util.Vector Enum2Vector(java.util.Enumeration e)
e - input enumeration
public static int[] byteToIntArray(byte[] data,
int offset,
int length)
data - array of unsigned bytesoffset - location in array to begin conversionlength - number of bytes to convert
public static byte[] intToByteArray(int[] data,
int offset,
int length)
data - array of unsigned intsoffset - locationin array to begin conversionlength - number of bytes to convert
public static int[] byteToIntArray(byte[] data)
data - array of unsigned bytes
public static byte[] intToByteArray(int[] data)
data - array of unsigned ints
public static byte[] concat(byte[] b1,
byte[] b2)
b1 - first byte arrayb2 - second byte array
public static void integerToArray(int integer,
byte[] b,
int offset)
integer - int to convertb - destination byte arrayoffset - offset within array to store integer at (4 bytes)
public static int arrayToInteger(byte[] b,
int offset)
b - byte arrayoffset - offset within array to read integer from (4 bytes)
public static void shortToArray(short i,
byte[] b,
int offset)
i - short to convertb - destination byte arrayoffset - offset within array to store short at (2 bytes)
public static short arrayToShort(byte[] b,
int offset)
b - byte arrayoffset - offset within array to read short from (2 bytes)
public static void InetAddressToArray(java.net.InetAddress inet,
byte[] b,
int offset)
inet - Internet address to convertb - destination byte arrayoffset - offset within array to store address at (4 bytes)
public static java.net.InetAddress arrayToInetAddress(byte[] b,
int offset)
b - byte arrayoffset - offset within array to read address from (4 bytes)
public static byte[] stringToArray(java.lang.String s)
s - string to convert
public static java.lang.String arrayToString(byte[] b,
int offset)
b - byte arrayoffset - offset within array to read string from (4 bytes + string)
public static byte[] objectToArray(java.lang.Object s)
s - object to convert
public static java.lang.Object arrayToObject(byte[] b,
int offset)
b - byte arrayoffset - offset within array to read object from (4 bytes + object)
public static java.lang.Object arrayToObject(byte[] b)
b - byte array
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||