def _dumpArrayDictToFile(filelike, arrayDict):
    """Function to serialize and write ``numpy.array`` contained in a dictionary
    to a file. See also :func:`_dumpArrayToFile` and :func:`_dumpNdarrayToFile`.


    :param filelike: can be a file or a file-like object that provides the
        methods ``.write()`` and ``.tell()``.
    :param arrayDict: a dictionary which values are ``numpy.array``, that are
        serialized to bytes and written to the filelike.

    :returns: a list of metadata dictionaries
        a metadata dictionary contains information necessary to restore the
        ``numpy.arrays`` from the file and the corresponding key from the
        arrayDict as 'arrayKey'.
    """
    metadataList = list()
    for arrayKey in sorted(arrayDict):
        array = arrayDict[arrayKey]
        if array.ndim == 1:
            metadata = _dumpArrayToFile(filelike, array)
        else:
            metadata = _dumpNdarrayToFile(filelike, array)
        metadata['arrayKey'] = arrayKey
        metadataList.append(metadata)
    return metadataList