Serializes the given data into the provided output stream.
the OutputStream to write the serialized data to
the SerializerData to serialize
if an I/O error occurs during serialization