Write up to count bytes from buffer at offset to the standard output stream. The number of bytes written will be returned.