private function init()
    {
        if ($this->encoder === null) {
            // Send the adapter config as JSON payload to the host
            $config = new AdapterConfig(
                $this->codec->getName(),
                $this->getAdapterType(),
                $this->getExtraConfig()
            );
            Codecs::json()->newEncoder($this->output)->useNewlines(false)->encode($config);

            // Set up encoder / decoder for further communication
            $this->decoder = $this->codec->newDecoder($this->input);
            $this->encoder = $this->codec->newEncoder($this->output);
        }
    }