nsIStreamListener

nsIStreamListener

Methods

onDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount)

Called when 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: The aInputStream parameter must implement readSegments.

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

Parameters

aRequest request corresponding to the source of the data
aContext user defined context
aInputStream input stream containing the data chunk
aOffset Number of bytes that were sent in previous onDataAvailable calls for this request. In other words, the sum of all previous count parameters.
aCount number of bytes available in the stream