Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Close the stream. Forces the output stream to flush any buffered data. Any subsequent calls to StreamStatus should throw NS_BASE_STREAM_CLOSED. Succeeds without effect if already closed.
NS_BASE_STREAM_WOULD_BLOCK if unable to flush without blocking the calling thread (non-blocking mode only)
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.
NOTE: a non-blocking output stream may implement nsIAsyncOutputStream to provide consumers with a way to wait for the stream to accept more data once its write method is unable to accept any data without blocking.
Check the current status of the stream. A stream that is closed will throw an exception when this method is called. That enables the caller to know the condition of the stream before attempting to write into it.
This method will not throw NS_BASE_STREAM_WOULD_BLOCK, even if the stream is a non-blocking stream with no available space. A non-blocking stream which has not been closed, but has no available room should return NS_OK.
NOTE: This method should not block the calling thread (e.g. to query the state of a file descriptor), even when called on a blocking stream.
NS_BASE_STREAM_CLOSED if the stream closed normally
Write data into the stream.
number of bytes written (may be less than aCount)
NS_BASE_STREAM_WOULD_BLOCK if writing to the output stream would block the calling thread (non-blocking mode only)
the buffer containing the data to be written
the maximum number of bytes to be written
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.
Writes data into the stream from an input stream.
number of bytes written (may be less than aCount)
NS_BASE_STREAM_WOULD_BLOCK if writing to the output stream would block the calling thread (non-blocking mode only). This failure means no bytes were transferred.
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.
the stream containing the data to be written
the maximum number of bytes to be written
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.
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.
number of bytes written (may be less than aCount)
NS_BASE_STREAM_WOULD_BLOCK if writing to the output stream would block the calling thread (non-blocking mode only). This failure means no bytes were transferred.
NS_ERROR_NOT_IMPLEMENTED if the stream has no underlying buffer
NOTE: this function may be unimplemented if a stream has no underlying buffer (e.g., socket output stream).
the "provider" of the data to be written
opaque parameter passed to reader
the maximum number of bytes to be written
Generated using TypeDoc
See
nsIObjectInputStream
See
nsIBinaryOutputStream