public function write($string) : int
	{
		if (! \is_resource($this->resource))
		{
			throw new Exception\UnwritableStreamException('Stream is not resourceable');
		}

		if (! $this->isWritable())
		{
			throw new Exception\UnwritableStreamException('Stream is not writable');
		}

		$result = \fwrite($this->resource, $string);

		if (false === $result)
		{
			throw new Exception\UnwritableStreamException('Unable to write to the stream');
		}

		return $result;
	}