def METHOD_NAME(obj: Any, stream: BinaryIO, **kwargs):
    """Serialize object and write the data to a stream.
    Args:
        obj: Object to be serialized
        stream: Stream to write the result to
        kwargs: Arguments passed to msgpack.packb
    """
    data = serialize(obj, **kwargs)
    stream.write(data)