« XPCOM API Reference
Summary
This method copies data from a buffer into the stream.
unsigned long write(
in string aBuf,
in unsigned long aCount
);
Parameters
- aBuf
- [in] The buffer containing the data to be written.
- aCount
- [in] The size of the buffer, or the maximum number of bytes to copy from the buffer.
Return Values
This method returns the number of bytes copied from the buffer.
Exceptions Thrown
- NS_BASE_STREAM_WOULD_BLOCK
- Indicates that writing to the output stream would block the calling thread for an indeterminate amount of time. This exception may only be thrown if isNonBlocking returns true.
Remarks
Though this method is scriptable, JavaScript code must only pass an ASCII character string as the aBuf parameter. C++ code may however pass any arbitrary binary data, including data with embedded null bytes.