« Справочник XPCOM API


Этот метод копирует данные из nsIInputStream в nsIOutputStream.

 unsigned long writeFrom(
   in nsIInputStream aSource,
   in unsigned long aCount


[in] An nsIInputStream containing the data to be written.
[in] The maximum number of bytes to write to the stream.

Возвращаемые значения

Этот метод возвращает количество байт, записанных в поток.

Exceptions Thrown

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.
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.


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.

См. также