protected function getDecoder(
        string $stream,
        string $contentType,
        int $contentLength,
        decoder\DecoderOptions $options
    )
    {
        $type = \sndsgd\Str::before($contentType, ";");
        if (!isset(static::$decoders[$type])) {
            throw new exception\BadRequestException(
                "failed to decode request body; ".
                "unknown content-type '$contentType'"
            );
        }

        $class = static::$decoders[$type];
        return new $class($stream, $contentType, $contentLength, $options);
    }