nsIRequestObserver
Last changed in Gecko 1.0 Classes which want to consume data from a nsIChannel
need to implement this interface. nsIRequestObserver
contains two methods. So, in all the three methods - onDataAvailable()
, nsIRequestObserver.onStartRequest()
and nsIRequestObserver.onStopRequest()
have to be implemented.
void onDataAvailable(in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); |
This method is called when the next chunk of data for the ongoing request may be read without blocking the calling thread. The data can be read from the nsIInputStream object passed as the argument to this method.
aCount
bytes of data before returning.void onDataAvailable( in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount );
aRequest
nsIRequest
indicating the source of the data.aContext
aInputStream
nsIInputStream
from which the data is to be read.aOffset
onDataAvailable()
calls for this request. In other words, the sum of all previous count parameters. If that number is greater than or equal to 2^32, this parameter will be PR_UINT32_MAX (2^32 - 1).aCount