code: @Nullable
      @SuppressWarnings("FloatingPointEquality")
      private static HttpEncodingType determineEncoding(String acceptEncoding) {
          float starQ = -1.0f;
          float gzipQ = -1.0f;
          float deflateQ = -1.0f;
          for (String encoding : acceptEncoding.split(",")) {
              float q = 1.0f;
              final int equalsPos = encoding.indexOf('=');
              if (equalsPos != -1) {
                  try {
                      q = Float.parseFloat(encoding.substring(equalsPos + 1));
                  } catch (NumberFormatException e) {
                      // Ignore encoding
                      q = 0.0f;
                  }
              }
              if (encoding.contains("*")) {
                  starQ = q;
              } else if (encoding.contains("gzip") && q > gzipQ) {
                  gzipQ = q;
              } else if (encoding.contains("deflate") && q > deflateQ) {
                  deflateQ = q;
              }
          }
          if (gzipQ > 0.0f || deflateQ > 0.0f) {
              if (gzipQ >= deflateQ) {
                  return HttpEncodingType.GZIP;
              } else {
                  return HttpEncodingType.DEFLATE;
              }
          }
          if (starQ > 0.0f) {
              if (gzipQ == -1.0f) {
                  return HttpEncodingType.GZIP;
              }
              if (deflateQ == -1.0f) {
                  return HttpEncodingType.DEFLATE;
              }
          }
          return null;
      }
docs: Copied from netty's HttpContentCompressor.