Write data to the stream.
string $data: Piece of string to write to the stream. If the value is not directly a string, casting will happen in writing.
Exception If writing the data is not possible.
private function write($data) {
$result = fputs($this->_fd, $data);
if ($result === FALSE) {
throw new Exception('Unable to write data: ' . substr($data, 0, 20));
}
}