Tries to write to stream, as with write (if
blocking is true) or
write_nonblocking (if blocking is
false).
This can be used to more easily share code between blocking and non-blocking implementations of a method.
If blocking is false, then stream must be a
PollableOutputStream for which
can_poll returns true
or else the behavior is undefined. If blocking is true, then
stream does not need to be a PollableOutputStream.
| stream |
a OutputStream. |
| buffer |
the buffer containing the data to write. |
| blocking |
whether to do blocking I/O |
| cancellable |
optional Cancellable object, null to ignore. |
| count |
the number of bytes to write |
|
the number of bytes written, or -1 on error. |