Public Member Functions

nsIAsyncStreamCopier Interface Reference

import "nsIAsyncStreamCopier.idl";

Inheritance diagram for nsIAsyncStreamCopier:
Collaboration diagram for nsIAsyncStreamCopier:

List of all members.

Public Member Functions

void init (in nsIInputStream aSource, in nsIOutputStream aSink, in nsIEventTarget aTarget, in boolean aSourceBuffered, in boolean aSinkBuffered, in unsigned long aChunkSize, in boolean aCloseSource, in boolean aCloseSink)
 Initialize the stream copier.
void asyncCopy (in nsIRequestObserver aObserver, in nsISupports aObserverContext)
 asyncCopy triggers the start of the copy.

Member Function Documentation

void nsIAsyncStreamCopier::asyncCopy ( in nsIRequestObserver  aObserver,
in nsISupports  aObserverContext 

asyncCopy triggers the start of the copy.

The observer will be notified when the copy completes.

aObserver receives notifications.
aObserverContext passed to observer methods.
void nsIAsyncStreamCopier::init ( in nsIInputStream  aSource,
in nsIOutputStream  aSink,
in nsIEventTarget  aTarget,
in boolean  aSourceBuffered,
in boolean  aSinkBuffered,
in unsigned long  aChunkSize,
in boolean  aCloseSource,
in boolean  aCloseSink 

Initialize the stream copier.

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.

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

The documentation for this interface was generated from the following file: