def METHOD_NAME(stream):
    for v in contents:
        if type(v) is str:
            stream.write_string(v)
        elif type(v) is int:
            stream.write_int64(v)
        elif type(v) is float:
            stream.write_single(v)
        elif type(v) is bool:
            stream.write_bool(v)
    stream.flush()