'>>> driver = DummyStorageDriver(\'key\', \'secret\')
>>> container = driver.create_container(
...    container_name=\'test container 1\')
... #doctest: +IGNORE_EXCEPTION_DETAIL
>>> obj = container.upload_object_via_stream(
...   object_name=\'test object\', iterator=DummyFileObject(5, 10),
...   extra={})
>>> obj #doctest: +ELLIPSIS
<Object: name=test object, size=50, ...>
@inherits: :class:`StorageDriver.upload_object_via_stream`'

def upload_object_via_stream(self, iterator, container, object_name, extra=None):

    size = len(iterator)
    return self._add_object(container=container, object_name=object_name, size=size, extra=extra)
