A wrapper for an nsIChannel that buffers the incoming data. More...
import"sbIMetadataChannel.idl";
Public Member Functions | |
void | open (in nsIChannel aChannel, in sbIMetadataHandler aHandler) |
Open the channel and start downloading the file. More... | |
void | close () |
Close the channel and free all references. More... | |
void | skip (in PRUint64 aDistance) |
Skip forward in the read buffer. More... | |
PRUint32 | read (in charPtr aBuffer, in PRUint32 aSize) |
Read from the buffer. More... | |
char | readChar () |
Read a byte from the buffer. More... | |
PRInt32 | readInt32 () |
Read a 32bit int from the buffer. More... | |
PRInt64 | readInt64 () |
Read a 32bit int from the buffer. More... | |
Public Attributes | |
attribute PRUInt64 | pos |
The current read position (for the read methods) More... | |
readonly attribute PRUInt64 | buf |
The current internal buffer position (everything the channel has sent) More... | |
readonly attribute PRUInt64 | size |
The size of the file targeted by the nsIChannel. More... | |
readonly attribute PRBool | seekable |
If the datastream is seekable. More... | |
readonly attribute PRBool | completed |
If the nsIChannel has finished (by completion or error) More... | |
A wrapper for an nsIChannel that buffers the incoming data.
Every time the channel reports it has data available (or a change in state) it will call the given sbIMetadataHandler::onChannelData method.
This class provides buffered read methods for the handler to retrieve data.
Definition at line 49 of file sbIMetadataChannel.idl.
void sbIMetadataChannel::close | ( | ) |
Close the channel and free all references.
void sbIMetadataChannel::open | ( | in nsIChannel | aChannel, |
in sbIMetadataHandler | aHandler | ||
) |
Open the channel and start downloading the file.
An instance of sbIMetadataHandler passes itself and an nsIChannel into this method in order to start transferring data across the channel.
Every time the channel reports it has data available (or a change in state) it will call the given sbIMetadataHandler::onChannelData method.
aChannel | The channel from which to download |
aHandler | The handler to be informed of the download progress |
PRUint32 sbIMetadataChannel::read | ( | in charPtr | aBuffer, |
in PRUint32 | aSize | ||
) |
Read from the buffer.
aBuffer | The buffer into which to read |
aSize | The size of the buffer in bytes |
char sbIMetadataChannel::readChar | ( | ) |
Read a byte from the buffer.
PRInt32 sbIMetadataChannel::readInt32 | ( | ) |
Read a 32bit int from the buffer.
PRInt64 sbIMetadataChannel::readInt64 | ( | ) |
Read a 32bit int from the buffer.
void sbIMetadataChannel::skip | ( | in PRUint64 | aDistance | ) |
Skip forward in the read buffer.
aDistance | The number of bytes to skip forward in the buffer (you can pass negative numbers) |
readonly attribute PRUInt64 sbIMetadataChannel::buf |
The current internal buffer position (everything the channel has sent)
Definition at line 59 of file sbIMetadataChannel.idl.
readonly attribute PRBool sbIMetadataChannel::completed |
If the nsIChannel has finished (by completion or error)
Definition at line 72 of file sbIMetadataChannel.idl.
attribute PRUInt64 sbIMetadataChannel::pos |
The current read position (for the read methods)
Definition at line 55 of file sbIMetadataChannel.idl.
readonly attribute PRBool sbIMetadataChannel::seekable |
If the datastream is seekable.
Definition at line 68 of file sbIMetadataChannel.idl.
readonly attribute PRUInt64 sbIMetadataChannel::size |
The size of the file targeted by the nsIChannel.
Definition at line 63 of file sbIMetadataChannel.idl.