Public Member Functions

nsIBinaryInputStream Interface Reference

This interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, i.e. More...

import "nsIBinaryInputStream.idl";

Inheritance diagram for nsIBinaryInputStream:
Collaboration diagram for nsIBinaryInputStream:

List of all members.

Public Member Functions

void setInputStream (in nsIInputStream aInputStream)
PRBool readBoolean ()
 Read 8-bits from the stream.
PRUint8 read8 ()
PRUint16 read16 ()
PRUint32 read32 ()
PRUint64 read64 ()
float readFloat ()
double readDouble ()
ACString readCString ()
 Read an 8-bit pascal style string from the stream.
AString readString ()
 Read an 16-bit pascal style string from the stream.
void readBytes (in PRUint32 aLength,[size_is(aLength), retval] out string aString)
 Read an opaque byte array from the stream.
void readByteArray (in PRUint32 aLength,[array, size_is(aLength), retval] out PRUint8 aBytes)
 Read an opaque byte array from the stream, storing the results as an array of PRUint8s.

Detailed Description

This interface allows consumption of primitive data types from a "binary stream" containing untagged, big-endian binary data, i.e.

as produced by an implementation of nsIBinaryOutputStream. This might be used, for example, to implement network protocols or to read from architecture-neutral disk files, i.e. ones that can be read and written by both big-endian and little-endian platforms.

nsIBinaryOutputStream


Member Function Documentation

PRUint16 nsIBinaryInputStream::read16 (  ) 
PRUint32 nsIBinaryInputStream::read32 (  ) 
PRUint64 nsIBinaryInputStream::read64 (  ) 
PRUint8 nsIBinaryInputStream::read8 (  ) 
PRBool nsIBinaryInputStream::readBoolean (  ) 

Read 8-bits from the stream.

Returns:
that byte to be treated as a boolean.
void nsIBinaryInputStream::readByteArray ( in PRUint32  aLength,
[array, size_is(aLength), retval] out PRUint8  aBytes 
)

Read an opaque byte array from the stream, storing the results as an array of PRUint8s.

Parameters:
aLength the number of bytes that must be read.
Exceptions:
NS_ERROR_FAILURE if it can't read aLength bytes
void nsIBinaryInputStream::readBytes ( in PRUint32  aLength,
[size_is(aLength), retval] out string  aString 
)

Read an opaque byte array from the stream.

Parameters:
aLength the number of bytes that must be read.
Exceptions:
NS_ERROR_FAILURE if it can't read aLength bytes
ACString nsIBinaryInputStream::readCString (  ) 

Read an 8-bit pascal style string from the stream.

32-bit length field, followed by length 8-bit chars.

double nsIBinaryInputStream::readDouble (  ) 
float nsIBinaryInputStream::readFloat (  ) 
AString nsIBinaryInputStream::readString (  ) 

Read an 16-bit pascal style string from the stream.

32-bit length field, followed by length PRUnichars.

void nsIBinaryInputStream::setInputStream ( in nsIInputStream  aInputStream  ) 

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