nsIBinaryInputStream

IID:7b456cb0-8772-11d3-90cf-0040056a906e
Inherits From:nsIInputStream

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.

This interface is intended to be used as an instance. To create an object implementing this interface:

var obj = Components.classes["@mozilla.org/binaryinputstream;1"].
            createInstance(Components.interfaces.nsIBinaryInputStream);

This interface is implemented by the following components:


Methods

PRUint16 read16 ( ) PRUint32 read32 ( ) PRUint64 read64 ( ) PRUint8 read8 ( ) PRBool readBoolean ( ) void readByteArray ( PRUint32 length , out arrayof PRUint8 bytes ) void readBytes ( PRUint32 length , out char* string ) ACString readCString ( ) double readDouble ( ) float readFloat ( ) AString readString ( ) void setInputStream ( nsIInputStream inputStream )

PRUint16 read16 ( )


PRUint32 read32 ( )


PRUint64 read64 ( )


PRUint8 read8 ( )


PRBool readBoolean ( )


void readByteArray ( PRUint32 length , out arrayof PRUint8 bytes )

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

Arguments:
length
bytes

void readBytes ( PRUint32 length , out char* string )

Read an opaque byte array from a binary stream.

Arguments:
length
string

ACString readCString ( )

Read a NUL-terminated 8-bit char* string from a binary stream.


double readDouble ( )


float readFloat ( )


AString readString ( )

Read a NUL-terminated 16-bit PRUnichar* string from a binary stream.


void setInputStream ( nsIInputStream inputStream )

Arguments:
inputStream

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com