nsIStreamTransportService

IID:8268D474-EFBF-494f-A152-E8A8616F4E52
Inherits From:nsISupports

This service read/writes a stream on a background thread.

Use this service to transform any blocking stream (e.g., file stream) into a fully asynchronous stream that can be read/written without blocking the main thread.

This interface is intended to be used as a service.

This interface is implemented by the following components:


Methods

nsITransport createInputTransport ( nsIInputStream stream , PRInt64 startOffset , PRInt64 readLimit , PRBool closeWhenDone ) nsITransport createOutputTransport ( nsIOutputStream stream , PRInt64 startOffset , PRInt64 writeLimit , PRBool closeWhenDone )

nsITransport createInputTransport ( nsIInputStream stream , PRInt64 startOffset , PRInt64 readLimit , PRBool closeWhenDone )

Arguments:
stream: The input stream that will be read on a background thread. This stream must implement "blocking" stream semantics.
startOffset: The input stream will be read starting from this offset. Pass -1 to read from the current stream offset. NOTE: this parameter is ignored if the stream does not support nsISeekableStream.
readLimit: This parameter limits the number of bytes that will be read from the input stream. Pass -1 to read everything.
closeWhenDone: Specify this flag to have the input stream closed once its contents have been completely read.
Returns:
nsITransport instance.

nsITransport createOutputTransport ( nsIOutputStream stream , PRInt64 startOffset , PRInt64 writeLimit , PRBool closeWhenDone )

Arguments:
stream: The output stream that will be written to on a background thread. This stream must implement "blocking" stream semantics.
startOffset: The output stream will be written starting at this offset. Pass -1 to write to the current stream offset. NOTE: this parameter is ignored if the stream does not support nsISeekableStream.
writeLimit: This parameter limits the number of bytes that will be written to the output stream. Pass -1 for unlimited writing.
closeWhenDone: Specify this flag to have the output stream closed once its contents have been completely written.
Returns:
nsITransport instance.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com