sbIMetadataChannel Interface Reference

A wrapper for an nsIChannel that buffers the incoming data. More...

import"sbIMetadataChannel.idl";

Inheritance diagram for sbIMetadataChannel:
[legend]
Collaboration diagram for sbIMetadataChannel:
[legend]

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...
 

Detailed Description

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.

See Also
sbIMetadataHandler

Definition at line 49 of file sbIMetadataChannel.idl.

Member Function Documentation

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.

Parameters
aChannelThe channel from which to download
aHandlerThe handler to be informed of the download progress
PRUint32 sbIMetadataChannel::read ( in charPtr  aBuffer,
in PRUint32  aSize 
)

Read from the buffer.

Parameters
aBufferThe buffer into which to read
aSizeThe size of the buffer in bytes
Returns
The number of bytes read
char sbIMetadataChannel::readChar ( )

Read a byte from the buffer.

Returns
The byte read
PRInt32 sbIMetadataChannel::readInt32 ( )

Read a 32bit int from the buffer.

Returns
The value read
PRInt64 sbIMetadataChannel::readInt64 ( )

Read a 32bit int from the buffer.

Returns
The value read
void sbIMetadataChannel::skip ( in PRUint64  aDistance)

Skip forward in the read buffer.

Parameters
aDistanceThe number of bytes to skip forward in the buffer (you can pass negative numbers)

Member Data Documentation

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)

Todo:
Make "SetPos()" work past the end of the buffer. Right now, nothing is seekable.

Definition at line 55 of file sbIMetadataChannel.idl.

readonly attribute PRBool sbIMetadataChannel::seekable

If the datastream is seekable.

Todo:
Make "GetSeekable()" work. Right now, nothing 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.


The documentation for this interface was generated from the following file: