docs: private static void exploreExtensions(ByteBuffer input, List<String> alpnProtocols, ByteArrayOutputStream out)
              throws SSLException {
          ByteArrayOutputStream extensionOut = out == null ? null : new ByteArrayOutputStream();
          int length = getInt16(input);           // length of extensions
          writeInt16(extensionOut, 0); //placeholder
          while (length > 0) {
              int extType = getInt16(input);      // extenson type
              writeInt16(extensionOut, extType);
              int extLen = getInt16(input);       // length of extension data
              writeInt16(extensionOut, extLen);
              if (extType == 16) {      // 0x00: ty
                  if(out == null) {
                      exploreALPNExt(input, alpnProtocols);
                  } else {
                      throw new ALPNPresentException();
                  }
              } else {                    // ignore other extensions
                  processByteVector(input, extLen, extensionOut);
              }
  
              length -= extLen + 4;
          }
          if(out != null) {
              byte[] alpnBits = generateAlpnExtension(alpnProtocols);
              extensionOut.write(alpnBits,0 ,alpnBits.length);
              byte[] extensionsData = extensionOut.toByteArray();
              int newLength = extensionsData.length - 2;
              extensionsData[0] = (byte) ((newLength >> 8) & 0xFF);
              extensionsData[1] = (byte) (newLength & 0xFF);
              out.write(extensionsData, 0, extensionsData.length);
          }
  
      }