Summary
Этот метод копирует данные из nsIInputStream
в nsIOutputStream
.
unsigned long writeFrom( in nsIInputStream aSource, in unsigned long aCount );
Параметры
- aSource
- [in] An nsIInputStream containing the data to be written.
- aCount
- [in] The maximum number of bytes to write to the stream.
Возвращаемые значения
Этот метод возвращает количество байт, записанных в поток.
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. - NS_ERROR_NOT_IMPLEMENTED
-
Indicates that the stream does not implement this method. Typically, output streams that do not have an internal buffer will not implement this method since such an implementation would require an intermediate buffer unless aSource supported
nsIInputStream::readSegments
, but that is not guaranteed.
Remarks
A nsIOutputStream
is not required to implement this method. In some contexts, writeFrom
may be guaranteed to be implemented, but in general it is not. This method serves as an optimization.