nsIUnicharStreamLoaderObserver

Methods

onDetermineCharset(aLoader, aContext, aSegment)

Called as soon as at least 512 octets of data have arrived.
If the stream receives fewer than 512 octets of data in total,
called upon stream completion but before calling OnStreamComplete.
Will not be called if the stream receives no data at all.

Parameters

aLoader the unichar stream loader
aContext the context parameter of the underlying channel
aSegment up to 512 octets of raw data from the stream

Returns

the name of the character set to be used to decode this stream

onStreamComplete(aLoader, aContext, aStatus, aBuffer)

Called when the entire stream has been loaded and decoded.

This method will always be called asynchronously by the
nsUnicharIStreamLoader involved, on the thread that called the
loader’s init() method. If onDetermineCharset fails,
onStreamComplete will still be called, but aStatus will be an
error code.

Parameters

aLoader the unichar stream loader
aContext the context parameter of the underlying channel
aStatus the status of the underlying channel
aBuffer the contents of the stream, decoded to UTF-16.