nsIAsyncStreamCopier

Methods

init(aSource, aSink, aTarget, aSourceBuffered, aSinkBuffered, aChunkSize, aCloseSource, aCloseSink)

Initialize the stream copier.

NOTE: at least one of the streams must be buffered. If you do not know
whether your streams are buffered, you should use nsIAsyncStreamCopier2
instead.

Parameters

aSource contains the data to be copied.
aSink specifies the destination for the data.
aTarget specifies the thread on which the copy will occur. a null value is permitted and will cause the copy to occur on an unspecified background thread.
aSourceBuffered true if aSource implements ReadSegments.
aSinkBuffered true if aSink implements WriteSegments.
aChunkSize specifies how many bytes to read/write at a time. this controls the granularity of the copying. it should match the segment size of the "buffered" streams involved.
aCloseSource true if aSource should be closed after copying.
aCloseSink true if aSink should be closed after copying.

asyncCopy(aObserver, aObserverContext)

asyncCopy triggers the start of the copy. The observer will be notified
when the copy completes.

Parameters

aObserver receives notifications.
aObserverContext passed to observer methods.