public class DataSerializer extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
PACKET_HEADER_SIZE |
| Constructor and Description |
|---|
DataSerializer() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
deserialize(byte[] data)
Deserializes a
byte[] buffer into a Serializable obhect. |
static byte[] |
packetize(byte[] data)
Packetizes a
byte[] array of data to send over the wire. |
static byte[] |
serialize(Object obj)
Serializes a
Serializable object using FST. |
public static final int PACKET_HEADER_SIZE
public static byte[] serialize(Object obj)
Serializable object using FST.obj - The Serializable object to serialize.byte[] array of data.public static Object deserialize(byte[] data)
byte[] buffer into a Serializable obhect.data - The byte[] buffer to deserialize.Object.public static byte[] packetize(byte[] data)
byte[] array of data to send over the wire. This format is (packet size)(bytes[]).data - byte[] array to packetize.byte[] array containing the size of the payload in the header.Copyright © 2015. All rights reserved.