Method
StringBuffer::writeToResource
Starts a coroutine that writes the buffer to the stream until the buffer has ended and been read.
Description#
public StringBuffer::writeToResource(
$resource
): FiberWith several streams on one buffer, there is no control over which data goes where.
Parameters#
- $resource
- A stream to write to
Return values#
The coroutine; its result is the number of bytes written Fiber
Errors / Exceptions#
| Exception | When |
|---|---|
InvalidArgumentException | If $resource is not a stream |
See also#
StringBuffer::readFromResourceStarts a coroutine that reads the stream into the buffer, and ends the buffer when the stream ends.