public function getMetadata($key = null)
	{
		if (! \is_resource($this->resource))
		{
			return null;
		}

		$metadata = \stream_get_meta_data($this->resource);

		if (! (null === $key))
		{
			return $metadata[$key] ?? null;
		}

		return $metadata;
	}