public function getMetadata($key = null)
    {
        $meta = [
            'timed_out' => false,
            'blocked' => true,
            'eof' => $this->eof(),
            'unread_bytes' => strlen($this->buffer),
            'stream_type' => get_class($this->encoder),
            'wrapper_type' => 'OBJECT',
            'wrapper_data' => [
                'step' => $this->encoder->key(),
                'errors' => $this->encoder->getErrors(),
            ],
            'mode' => 'r',
            'seekable' => true,
            'uri' => '',
        ];

        return $key === null ? $meta : (isset($meta[$key]) ? $meta[$key] : null);
    }