|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.SerializationUtils
public final class SerializationUtils
Utility methods for serializing and deserializing data
| Method Summary | |
|---|---|
static boolean |
readBoolean(byte[] data,
int offset)
Deserialize an int value from an array of bytes. |
static char |
readChar(byte[] data,
int offset)
Deserialize an int value from an array of bytes. |
static int |
readInt(byte[] data,
int offset)
Deserialize an int value from an array of bytes. |
static int |
readInt(InputStream is)
Deserialize an int value from a stream. |
static int |
readInt(ReadableByteChannel channel)
Read an integer value from a channel. |
static long |
readLong(byte[] data,
int offset)
Deserialize an int value from an array of bytes. |
static long |
readLong(InputStream is)
Deserialize an int value from a stream. |
static short |
readShort(byte[] data,
int offset)
Deserialize an int value from an array of bytes. |
static byte[] |
writeBoolean(boolean value,
byte[] data,
int offset)
Serialize an int value into an array of bytes. |
static byte[] |
writeChar(char value,
byte[] data,
int offset)
Serialize an int value into an array of bytes. |
static byte[] |
writeInt(int value)
Serialize an int value into an array of bytes. |
static byte[] |
writeInt(int value,
byte[] data,
int offset)
Serialize an int value into an array of bytes. |
static void |
writeInt(int value,
OutputStream os)
Serialize an int value to a stream. |
static void |
writeInt(WritableByteChannel channel,
int value)
Wrtie an integer value to a channel. |
static byte[] |
writeLong(long value,
byte[] data,
int offset)
Serialize a long value into an array of bytes. |
static byte[] |
writeShort(short value,
byte[] data,
int offset)
Serialize an int value into an array of bytes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static byte[] writeInt(int value)
value - the int value to serialize.
public static byte[] writeBoolean(boolean value,
byte[] data,
int offset)
value - the int value to serialize.data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static byte[] writeChar(char value,
byte[] data,
int offset)
value - the int value to serialize.data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static byte[] writeShort(short value,
byte[] data,
int offset)
value - the int value to serialize.data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static byte[] writeInt(int value,
byte[] data,
int offset)
value - the int value to serialize.data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static byte[] writeLong(long value,
byte[] data,
int offset)
value - the int value to serialize.data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static void writeInt(int value,
OutputStream os)
throws IOException
value - the int value to serialize.os - the stream to write to.
IOException - if an error occurs while writing the data.
public static void writeInt(WritableByteChannel channel,
int value)
throws IOException
channel - the channel to write to.value - the value to write.
IOException - if an error occurs while writing the data.
public static int readInt(ReadableByteChannel channel)
throws IOException
channel - the channel to read from.
IOException - if an error occurs while reading the data.
public static boolean readBoolean(byte[] data,
int offset)
data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static char readChar(byte[] data,
int offset)
data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static short readShort(byte[] data,
int offset)
data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static int readInt(byte[] data,
int offset)
data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static long readLong(byte[] data,
int offset)
data - the array of bytes into which to serialize the value.offset - the position in the array of byte at which the serializatrion should start.
public static int readInt(InputStream is)
throws IOException
is - the stream to read from.
IOException - if an error occurs while reading the data.
public static long readLong(InputStream is)
throws IOException
is - the stream to read from.
IOException - if an error occurs while reading the data.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||