Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions
nsIObjectOutputStream Interface Reference

nsIObjectInputStream nsIBinaryOutputStream More...

import "nsIObjectOutputStream.idl";

Inheritance diagram for nsIObjectOutputStream:
Inheritance graph
[legend]
Collaboration diagram for nsIObjectOutputStream:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void writeObject (in nsISupports aObject, in PRBool aIsStrongRef)
 Write the object whose "root" or XPCOM-identity nsISupports is aObject.
void writeSingleRefObject (in nsISupports aObject)
 Write an object referenced singly and strongly via its root nsISupports or a subclass of its root nsISupports.
void writeCompoundObject (in nsISupports aObject, in nsIIDRef aIID, in PRBool aIsStrongRef)
 Write the object referenced by an interface pointer at aObject that inherits from a non-primary nsISupports, i.e., a reference to one of the multiply inherited interfaces derived from an nsISupports other than the root or XPCOM-identity nsISupports; or a reference to an inner object in the case of true XPCOM aggregation.
void writeID (in nsIDRef aID)
charPtr getBuffer (in PRUint32 aLength, in PRUint32 aAlignMask)
 Optimized serialization support -- see nsIStreamBufferAccess.idl.
void putBuffer (in charPtr aBuffer, in PRUint32 aLength)
void setOutputStream (in nsIOutputStream aOutputStream)
void writeBoolean (in PRBool aBoolean)
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 a NUL-terminated 8-bit char* string to a binary stream.
void writeWStringZ (in wstring aString)
 Write a NUL-terminated 16-bit PRUnichar* string to a binary stream.
void writeUtf8Z (in wstring aString)
 Write a NUL-terminated UTF8-encoded string to a binary stream, produced from a NUL-terminated 16-bit PRUnichar* string argument.
void writeBytes ([size_is(aLength)] in string aString, in PRUint32 aLength)
 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 close ()
 Close the stream.
void flush ()
 Flush the stream.
unsigned long write (in string aBuf, in unsigned long aCount)
 Write data into the stream.
unsigned long writeFrom (in nsIInputStream aFromStream, in unsigned long aCount)
 Writes data into the stream from an input stream.
unsigned long writeSegments (in nsReadSegmentFun aReader, in voidPtr aClosure, in unsigned long aCount)
 Low-level write method that has access to the stream's underlying buffer.
boolean isNonBlocking ()

Detailed Description

nsIObjectInputStream nsIBinaryOutputStream

Definition at line 48 of file nsIObjectOutputStream.idl.


Member Function Documentation

void nsIOutputStream::close ( ) [inherited]

Close the stream.

Forces the output stream to flush any buffered data.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)
void nsIOutputStream::flush ( ) [inherited]

Flush the stream.

Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif unable to flush without blocking the calling thread (non-blocking mode only)
charPtr nsIObjectOutputStream::getBuffer ( in PRUint32  aLength,
in PRUint32  aAlignMask 
)

Optimized serialization support -- see nsIStreamBufferAccess.idl.

Returns:
true if stream is non-blocking

NOTE: writing to a blocking output stream will block the calling thread until all given data can be consumed by the stream.

void nsIObjectOutputStream::putBuffer ( in charPtr  aBuffer,
in PRUint32  aLength 
)
unsigned long nsIOutputStream::write ( in string  aBuf,
in unsigned long  aCount 
) [inherited]

Write data into the stream.

Parameters:
aBufthe buffer containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure
void nsIBinaryOutputStream::write8 ( in PRUint8  aByte) [inherited]
void nsIBinaryOutputStream::writeByteArray ( [array, size_is(aLength)] in PRUint8  aBytes,
in PRUint32  aLength 
) [inherited]

Write an opaque byte array to a binary stream.

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

Write an opaque byte array to a binary stream.

void nsIObjectOutputStream::writeCompoundObject ( in nsISupports  aObject,
in nsIIDRef  aIID,
in PRBool  aIsStrongRef 
)

Write the object referenced by an interface pointer at aObject that inherits from a non-primary nsISupports, i.e., a reference to one of the multiply inherited interfaces derived from an nsISupports other than the root or XPCOM-identity nsISupports; or a reference to an inner object in the case of true XPCOM aggregation.

aIID identifies this interface.

void nsIBinaryOutputStream::writeDouble ( in double  aDouble) [inherited]
void nsIBinaryOutputStream::writeFloat ( in float  aFloat) [inherited]
unsigned long nsIOutputStream::writeFrom ( in nsIInputStream  aFromStream,
in unsigned long  aCount 
) [inherited]

Writes data into the stream from an input stream.

Parameters:
aFromStreamthe stream containing the data to be written
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: This method is defined by this interface in order to allow the output stream to efficiently copy the data from the input stream into its internal buffer (if any). If this method was provided as an external facility, a separate char* buffer would need to be used in order to call the output stream's other Write method.

void nsIObjectOutputStream::writeObject ( in nsISupports  aObject,
in PRBool  aIsStrongRef 
)

Write the object whose "root" or XPCOM-identity nsISupports is aObject.

The cause for writing this object is a strong or weak reference, so the aIsStrongRef argument must tell which kind of pointer is being followed here during serialization.

If the object has only one strong reference in the serialization and no weak refs, use writeSingleRefObject. This is a valuable optimization: it saves space in the stream, and cycles on both ends of the process.

If the reference being serialized is a pointer to an interface not on the primary inheritance chain ending in the root nsISupports, you must call writeCompoundObject instead of this method.

unsigned long nsIOutputStream::writeSegments ( in nsReadSegmentFun  aReader,
in voidPtr  aClosure,
in unsigned long  aCount 
) [inherited]

Low-level write method that has access to the stream's underlying buffer.

The reader function may be called multiple times for segmented buffers. WriteSegments is expected to keep calling the reader until either there is nothing left to write or the reader returns an error. WriteSegments should not call the reader with zero bytes to provide.

Parameters:
aReaderthe "provider" of the data to be written
aClosureopaque parameter passed to reader
aCountthe maximum number of bytes to be written
Returns:
number of bytes written (may be less than aCount)
Exceptions:
NS_BASE_STREAM_WOULD_BLOCKif writing to the output stream would block the calling thread (non-blocking mode only)
<other-error>on failure

NOTE: this function may be unimplemented if a stream has no underlying buffer (e.g., socket output stream).

Write an object referenced singly and strongly via its root nsISupports or a subclass of its root nsISupports.

There must not be other refs to aObject in memory, or in the serialization.

Write a NUL-terminated 8-bit char* string to a binary stream.

void nsIBinaryOutputStream::writeUtf8Z ( in wstring  aString) [inherited]

Write a NUL-terminated UTF8-encoded string to a binary stream, produced from a NUL-terminated 16-bit PRUnichar* string argument.

void nsIBinaryOutputStream::writeWStringZ ( in wstring  aString) [inherited]

Write a NUL-terminated 16-bit PRUnichar* string to a binary stream.


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