read

inline fun <T : Any> read(reader: ByteReader): T?

Reads a value of the reified type T? from the reader. Can return null if null was written.

Throws

if no serializer is registered for the type

if the creation of a serializer was prevented by the security manager


inline fun <T : Any> read(bytes: ByteArray, strict: Boolean = true): T?

Reads a value of the reified type T? from bytes. Can return null if null was written.

Throws

if strict is true and the byte array contains more data than was read

if no serializer is registered for the type

if the creation of a serializer was prevented by the security manager


fun <T : Any> read(type: KType, reader: ByteReader): T?

Reads a value of the type T? (type) from the reader. Can return null if null was written.

Throws

if no serializer is registered for the type

if the creation of a serializer was prevented by the security manager


fun <T : Any> read(type: KType, bytes: ByteArray, strict: Boolean = true): T?

Reads a value of the type T? (type) from bytes. Can return null if null was written.

Throws

if strict is true and the byte array contains more data than was read

if no serializer is registered for the type

if the creation of a serializer was prevented by the security manager