You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIStreamListener


This interface serves as notification that a chunk of data may be read without blocking the calling thread. It is scriptable.

Methods
onDataAvailable

Indicates the next chunk of data (corresponding to the request) may be read without blocking the calling thread. The onDataAvailable impl must read exactly aCount bytes of data before returning.

Note: An exception thrown from onDataAvailable has the side-effect of causing the request to be canceled.

Syntax:

void nsIStreamListener::onDataAvailable(
	in nsIRequest aRequest,in nsISupports aContext,
	in nsIInputStream aInputStream, 
	in unsigned long aOffset, in unsigned long aCount)  

Parameters:

aRequest: The request being observed.
aContext: A user defined context.
aInputStream: The input stream containing the data chunk.
aOffset: The current stream position.
aCount: The number of bytes available in the stream.

nsresult:

NS_OK if successful.

Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX