T - type of object to serialize@PublicEvolving public final class ObjectSerDe<T> extends Object
| Constructor and Description |
|---|
ObjectSerDe() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
toByteArray(T object)
Converts an object of type T into bytes.
|
T |
toObject(byte[] bytes)
Converts a serialized object byte array back into object.
|
public byte[] toByteArray(T object) throws IOException
object - to be serialized into bytes.IOExceptionpublic T toObject(byte[] bytes) throws IOException, ClassNotFoundException
bytes - to be converted to object of type T.IOExceptionClassNotFoundExceptiontoByteArray(Object)Copyright © 2024 CDAP Licensed under the Apache License, Version 2.0.