nsIOutputStream
| IID: | 0d0acd2a-61b4-11d4-9877-00c04fa0cf4a |
| Inherits From: | nsISupports |
This interface is implemented by the following components:
Methods
void close ( )
void flush ( )
PRBool isNonBlocking ( )
PRUint32 write ( char* buf , PRUint32 count )
PRUint32 writeFrom ( nsIInputStream fromStream , PRUint32 count )
[noscript] PRUint32 writeSegments ( nsReadSegmentFun reader , voidPtr* closure , PRUint32 count )
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.
- Returns:
- true if stream is non-blocking
PRUint32 write ( char* buf , PRUint32 count )
Write data into the stream.
- Arguments:
- buf: the buffer containing the data to be written
- count: the maximum number of bytes to be written
- Returns:
- number of bytes written (may be less than aCount)
PRUint32 writeFrom ( nsIInputStream fromStream , PRUint32 count )
Writes data into the stream from an input stream.
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.
- Arguments:
- fromStream: the stream containing the data to be written
- count: the maximum number of bytes to be written
- Returns:
- number of bytes written (may be less than aCount)
PRUint32 writeSegments ( nsReadSegmentFun reader , voidPtr* closure , PRUint32 count )
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.
NOTE: this function may be unimplemented if a stream has no underlying buffer (e.g., socket output stream).
- Arguments:
- reader: the "provider" of the data to be written
- closure: opaque parameter passed to reader
- count: the maximum number of bytes to be written
- Returns:
- number of bytes written (may be less than aCount)
References
This interface is the type of the following properties:
nsIDOMLSOutput.byteStream, nsIFastLoadFileIO.outputStream, nsIHttpResponse.bodyOutputStream, nsIInputStreamTee.sink, nsIMsgDatabase.folderStream, nsIMsgFilterList.logStream, nsIMsgFolder.offlineStoreOutputStream, nsISpamSettings.logStream
This interface is passed as an argument to the following methods:
nsIAppleFileDecoder.Initialize, nsIAsyncStreamCopier.init, nsIBinaryOutputStream.setOutputStream, nsIBufferedOutputStream.init, nsIConverterOutputStream.init, nsIDOMSerializer.serializeToStream, nsIDocumentEncoder.encodeToStream, nsIEditor.outputToStream, nsIFastLoadService.newOutputStream, nsIJSON.encodeToStream, nsIMimeEmitter.SetPipe, nsIMsgComposeSecure.beginCryptoEncapsulation, nsIMsgFilterList.saveToFile, nsIMsgFilterList.writeBoolAttr, nsIMsgFilterList.writeIntAttr, nsIMsgFilterList.writeStrAttr, nsIMsgFilterList.writeWstrAttr, nsIMsgFolder.copyDataToOutputStreamForAppend, nsIMsgParseMailMsgState.setDBFolderStream, nsIPersistentProperties.save, nsIPluginInstancePeer.newStream, nsIRDFXMLSource.Serialize, nsISimpleStreamListener.init, nsIStreamListenerTee.init, nsIStreamTransportService.createOutputTransport, rdfISerializer.serialize
This interface is returned from the following methods:
nsICacheEntryDescriptor.openOutputStream, nsIMsgSend.getOutputStream, nsIStorageStream.getOutputStream, nsITransport.openOutputStream
Reference documentation is generated from Mozilla's source.
