SerializationService

@DoNotImplement
interface SerializationService

Allows flows to serialize and deserialize objects to/from byte arrays.

Objects are serialized and deserialized using AMQP serialization.

Corda provides an instance of SerializationService to flows via property injection.

Functions

Link copied to clipboard
abstract fun <T : Any> deserialize(bytes: ByteArray, clazz: Class<T>): T
abstract fun <T : Any> deserialize(serializedBytes: SerializedBytes<T>, clazz: Class<T>): T

Deserializes the input serialized bytes into an object of type T.

Link copied to clipboard
abstract fun <T : Any> serialize(obj: T): SerializedBytes<T>

Serializes the input obj.

Extensions

Link copied to clipboard
inline fun <T : Any> SerializationService.deserialize(serializedBytes: SerializedBytes<T>): T
inline fun <T : Any> SerializationService.deserialize(bytes: ByteArray): T

Deserializes the input serialized bytes into an object of type T.