lithium\net\socket\Stream::write()

public method

writes data to the stream resource

Parameters

  • string $data

    The string to be written.

Returns

mixed

False on error, number of bytes written otherwise.

Source

	public function write($data = null) {
		if (!is_resource($this->_resource)) {
			return false;
		}
		if (!is_object($data)) {
			$data = $this->_instance($this->_classes['request'], (array) $data + $this->_config);
		}
		return fwrite($this->_resource, (string) $data, strlen((string) $data));
	}