nsIAsyncStreamCopier

IID:eaa49141-c21c-4fe8-a79b-77860a3910aa
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.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com