def get_and_save(
        self, pid, sciobj_stream, create_missing_dirs=False, vendorSpecific=None
    ):
        """Like MNRead.get(), but also retrieve the object bytes and store them in a
        stream. This method does not have the potential issue with excessive memory
        usage that get() with ``stream``=False has.

        Also see MNRead.get().

        """
        response = self.get(pid, stream=True, vendorSpecific=vendorSpecific)
        try:
            if create_missing_dirs:
                d1_common.utils.filesystem.create_missing_directories_for_file(
                    sciobj_stream
                )
            for chunk_str in response.iter_content(
                chunk_size=d1_common.const.DEFAULT_CHUNK_SIZE
            ):
                if chunk_str:
                    sciobj_stream.write(chunk_str)
        finally:
            response.close()
        return response
def get_and_save ( self , pid , sciobj_stream , create_missing_dirs = False , vendorSpecific = None ) : response = self . get ( pid , stream = True , vendorSpecific = vendorSpecific ) try : if create_missing_dirs : d1_common . utils . filesystem . create_missing_directories_for_file ( sciobj_stream ) for chunk_str in response . iter_content ( chunk_size = d1_common . const . DEFAULT_CHUNK_SIZE ) : if chunk_str : sciobj_stream . write ( chunk_str ) finally : response . close ( ) return response
Like MNRead.get(), but also retrieve the object bytes and store them in a
        stream. This method does not have the potential issue with excessive memory
        usage that get() with ``stream``=False has.

        Also see MNRead.get().