Function WriteByteBuffer(stream, ByRef buf, buf_size)

Writes a number of bytes from a buffer to the file stream.