Public Member Functions

nsIBinaryOutputStream Interface Reference

This interface allows writing of primitive data types (integers, floating-point values, booleans, etc. More...

import "nsIBinaryOutputStream.idl";

Inheritance diagram for nsIBinaryOutputStream:
Collaboration diagram for nsIBinaryOutputStream:

List of all members.

Public Member Functions

void setOutputStream (in nsIOutputStream aOutputStream)
void writeBoolean (in PRBool aBoolean)
 Write a boolean as an 8-bit char to the stream.
void write8 (in PRUint8 aByte)
void write16 (in PRUint16 a16)
void write32 (in PRUint32 a32)
void write64 (in PRUint64 a64)
void writeFloat (in float aFloat)
void writeDouble (in double aDouble)
void writeStringZ (in string aString)
 Write an 8-bit pascal style string to the stream.
void writeWStringZ (in wstring aString)
 Write a 16-bit pascal style string to the stream.
void writeUtf8Z (in wstring aString)
 Write an 8-bit pascal style string (UTF8-encoded) to the stream.
void writeBytes ([size_is(aLength)] in string aString, in PRUint32 aLength)
 Write an opaque byte array to the stream.
void writeByteArray ([array, size_is(aLength)] in PRUint8 aBytes, in PRUint32 aLength)
 Write an opaque byte array to the stream.

Detailed Description

This interface allows writing of primitive data types (integers, floating-point values, booleans, etc.

) to a stream in a binary, untagged, fixed-endianness format. This might be used, for example, to implement network protocols or to produce architecture-neutral binary disk files, i.e. ones that can be read and written by both big-endian and little-endian platforms. Output is written in big-endian order (high-order byte first), as this is traditional network order.

nsIBinaryInputStream


Member Function Documentation

void nsIBinaryOutputStream::setOutputStream ( in nsIOutputStream  aOutputStream  ) 
void nsIBinaryOutputStream::write16 ( in PRUint16  a16  ) 
void nsIBinaryOutputStream::write32 ( in PRUint32  a32  ) 
void nsIBinaryOutputStream::write64 ( in PRUint64  a64  ) 
void nsIBinaryOutputStream::write8 ( in PRUint8  aByte  ) 
void nsIBinaryOutputStream::writeBoolean ( in PRBool  aBoolean  ) 

Write a boolean as an 8-bit char to the stream.

void nsIBinaryOutputStream::writeByteArray ( [array, size_is(aLength)] in PRUint8  aBytes,
in PRUint32  aLength 
)

Write an opaque byte array to the stream.

void nsIBinaryOutputStream::writeBytes ( [size_is(aLength)] in string  aString,
in PRUint32  aLength 
)

Write an opaque byte array to the stream.

void nsIBinaryOutputStream::writeDouble ( in double  aDouble  ) 
void nsIBinaryOutputStream::writeFloat ( in float  aFloat  ) 
void nsIBinaryOutputStream::writeStringZ ( in string  aString  ) 

Write an 8-bit pascal style string to the stream.

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

void nsIBinaryOutputStream::writeUtf8Z ( in wstring  aString  ) 

Write an 8-bit pascal style string (UTF8-encoded) to the stream.

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

void nsIBinaryOutputStream::writeWStringZ ( in wstring  aString  ) 

Write a 16-bit pascal style string to the stream.

32-bit length field, followed by length PRUnichars.


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