def write_file(bytordp, data, filename):
    """
    data written as integers.
    """
    if bytordp == '0':
        fmt = '<i4'
    else:
        fmt = '>i4'
    with open(filename, 'wb') as f:
        f.write(data.astype(fmt).tostring())
