'Provides the implementations from HDUList.fromfile and
HDUList.fromstring, both of which wrap this method, as their
implementations are largely the same.'

@classmethod
def _readfrom(cls, fileobj=None, data=None, mode=None, memmap=None, save_backup=False, cache=True, lazy_load_hdus=True, **kwargs):

    if (fileobj is not None):
        if (not isinstance(fileobj, _File)):
            fileobj = _File(fileobj, mode=mode, memmap=memmap, cache=cache)
        mode = fileobj.mode
        hdulist = cls(file=fileobj)
    else:
        if (mode is None):
            mode = 'readonly'
        hdulist = cls(file=data)
    hdulist._save_backup = save_backup
    hdulist._open_kwargs = kwargs
    if ((fileobj is not None) and fileobj.writeonly):
        return hdulist
    read_one = hdulist._read_next_hdu()
    if ((not read_one) and (mode in ('readonly', 'denywrite'))):
        if hdulist._file.close_on_error:
            hdulist._file.close()
        raise IOError('Empty    or    corrupt    FITS    file')
    if (not lazy_load_hdus):
        while hdulist._read_next_hdu():
            pass
    hdulist._resize = False
    hdulist._truncate = False
    return hdulist
