Implemented by
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. @See nsIBinaryInputStream
[scriptable, uuid(204ee610-8765-11d3-90cf-0040056a906e)]
interface nsIBinaryOutputStream : nsIOutputStream
Methods
void
setOutputStream(in nsIOutputStream aOutputStream)
void
write16(in PRUint16 a16)
void
write32(in PRUint32 a32)
void
write64(in PRUint64 a64)
void
write8(in PRUint8 aByte)
void
writeBoolean(in PRBool aBoolean)
Write an opaque byte array to a binary stream.
void
writeByteArray([array, size_is(aLength)] in PRUint8 aBytes, in PRUint32 aLength)
Write an opaque byte array to a binary stream.
void
writeBytes([size_is(aLength)] in string aString, in PRUint32 aLength)
void
writeDouble(in double aDouble)
void
writeFloat(in float aFloat)
Write a NUL-terminated 8-bit char* string to a binary stream.
void
writeStringZ(in string aString)
Write a NUL-terminated UTF8-encoded string to a binary stream, produced from a NUL-terminated 16-bit PRUnichar* string argument.
void
writeUtf8Z(in wstring aString)
Write a NUL-terminated 16-bit PRUnichar* string to a binary stream.
void
writeWStringZ(in wstring aString)
Compare to: