public class SerializableUtils extends Object
| Constructor and Description |
|---|
SerializableUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Serializable> |
clone(T value) |
static Object |
deserializeFromByteArray(byte[] encodedValue,
String description)
Deserializes an object from the given array of bytes, e.g., as
serialized using
serializeToByteArray(java.io.Serializable), and returns it. |
static CloudObject |
ensureSerializable(Coder<?> coder)
Serializes a Coder and verifies that it can be correctly deserialized.
|
static <T extends Serializable> |
ensureSerializable(T value) |
static <T> T |
ensureSerializableByCoder(Coder<T> coder,
T value,
String errorContext)
Serializes an arbitrary T with the given
Coder<T> and verifies
that it can be correctly deserialized. |
static byte[] |
serializeToByteArray(Serializable value)
Serializes the argument into an array of bytes, and returns it.
|
public static byte[] serializeToByteArray(Serializable value)
IllegalArgumentException - if there are errors when serializingpublic static Object deserializeFromByteArray(byte[] encodedValue, String description)
serializeToByteArray(java.io.Serializable), and returns it.IllegalArgumentException - if there are errors when
deserializing, using the provided description to identify what
was being deserializedpublic static <T extends Serializable> T ensureSerializable(T value)
public static <T extends Serializable> T clone(T value)
public static CloudObject ensureSerializable(Coder<?> coder)
Throws a RuntimeException if serialized Coder cannot be deserialized, or if the deserialized instance is not equal to the original.
CloudObject