jckarter/clay — pull request #337 by stepancheg (2012-08-15 16:27:59+00:00)
Title: io.streams: write syscall can return before all data written

`write` syscall can return before all data written, for instance, when
write is interrupted or when descriptor is non-blocking.

This patch adds `writeBytes` function. `writeBytes` returns number of
bytes written, stream implementations must overload `writeBytes` now.

`write` functions return no values. `write(stream, buf, b)` now calls
`writeBytes` in loop until all data written.

Also add signature to `flush` function.