WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIAsyncStreamCopier

IID:72e515de-a91e-4154-bb78-e5244cbaae74
Inherits From:nsIRequest

This interface is implemented by the following components:


Methods

void asyncCopy ( nsIRequestObserver observer , nsISupports observerContext ) void init ( nsIInputStream source , nsIOutputStream sink , nsIEventTarget target , PRBool sourceBuffered , PRBool sinkBuffered , PRUint32 chunkSize )

void asyncCopy ( nsIRequestObserver observer , nsISupports observerContext )

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

Arguments:
observer: receives notifications.
observerContext: passed to observer methods.

void init ( nsIInputStream source , nsIOutputStream sink , nsIEventTarget target , PRBool sourceBuffered , PRBool sinkBuffered , PRUint32 chunkSize )

Initialize the stream copier.

NOTE: at least one of the streams must be buffered.

Arguments:
source: contains the data to be copied.
sink: specifies the destination for the data.
target: 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.
sourceBuffered: true if source implements ReadSegments.
sinkBuffered: true if sink implements WriteSegments.
chunkSize: 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.

Reference documentation is generated from Mozilla's source.