writeData

open override fun <P : Any, C : Any> writeData(type: PersistentDataType<P, C>, data: C)(source)

Writes data of a specific type to the output stream using the provided PersistentDataType.

The method uses the specified PersistentDataType to convert the complex data type into its corresponding primitive data type, which is then serialized and written to the output stream.

Parameters

type

the PersistentDataType used for defining the mapping between the complex and primitive types, as well as performing the data conversion

data

the data of the complex type to be written after conversion to its primitive form

Throws

if an I/O error occurs during the write process