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 = Libraries::instance(
				null, 'request', (array) $data + $this->_config, $this->_classes
			);
		}
		return fwrite($this->_resource, (string) $data, strlen((string) $data));
	}