Class JavaObjectSerdes
java.lang.Object
io.github.cjstehno.testthings.serdes.JavaObjectSerdes
- All Implemented Interfaces:
SerdesProvider
A
SerdesProvider based on the Java object serialization framework.
NOTE: This implementation does not support string-based operations.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tdeserialize(byte[] bytes, Class<? extends T> type) Deserializes the byte array to an object of the specified type.<T> Tdeserialize(String string, Class<? extends T> type) String-based deserialization is not supported.byte[]serializeToBytes(Object object) Serialize the object to bytes.serializeToString(Object object) String-based serialization is not supported.toString()
-
Constructor Details
-
JavaObjectSerdes
public JavaObjectSerdes()
-
-
Method Details
-
serializeToBytes
Description copied from interface:SerdesProviderSerialize the object to bytes.- Specified by:
serializeToBytesin interfaceSerdesProvider- Parameters:
object- the object- Returns:
- a byte array containing the serialized object
- Throws:
IOException- if there is a problem
-
serializeToString
String-based serialization is not supported.- Specified by:
serializeToStringin interfaceSerdesProvider- Parameters:
object- the object- Returns:
- a string containing the serialized object
- Throws:
IOException- if there is a problem
-
deserialize
Description copied from interface:SerdesProviderDeserializes the byte array to an object of the specified type.- Specified by:
deserializein interfaceSerdesProvider- Type Parameters:
T- the type of object- Parameters:
bytes- the byte arraytype- the object type- Returns:
- the object instance
- Throws:
IOException- if there is a problem
-
deserialize
String-based deserialization is not supported.- Specified by:
deserializein interfaceSerdesProvider- Type Parameters:
T- the type of object- Parameters:
string- the stringtype- the object type- Returns:
- the object instance
- Throws:
IOException- if there is a problem
-
toString
-