docs: public Buffer process(PacketOutputStream out, PacketInputStream in, AtomicInteger sequence)
            throws IOException, SQLException {
      int type = authData[0];
      String promptb;
      //conversation is :
      // - first byte is information tell if question is a password or clear text.
      // - other bytes are the question to user
  
      while (true) {
        promptb = new String(Arrays.copyOfRange(authData, 1, authData.length));
        if ("Password: ".equals(promptb) && password != null && !"".equals(password)) {
          //ask for password
          out.startPacket(sequence.incrementAndGet());
          byte[] bytePwd;
          if (passwordCharacterEncoding != null && !passwordCharacterEncoding.isEmpty()) {
            bytePwd = password.getBytes(passwordCharacterEncoding);
          } else {
            bytePwd = password.getBytes();
          }
          out.write(bytePwd, 0, bytePwd.length);
          out.write(0);
        } else {
          // 2 means "read the input with the echo enabled"
          // 4 means "password-like input, echo disabled"
  
          boolean isPassword = type == 4;
          //ask user to answer
          String password = showInputDialog(promptb, isPassword);
          if (password == null) {
            throw new SQLException("Error during PAM authentication : dialog input cancelled");
          }
          out.startPacket(sequence.incrementAndGet());
          byte[] bytePwd;
          if (passwordCharacterEncoding != null && !passwordCharacterEncoding.isEmpty()) {
            bytePwd = password.getBytes(passwordCharacterEncoding);
          } else {
            bytePwd = password.getBytes();
          }
          out.write(bytePwd, 0, bytePwd.length);
          out.write(0);
        }
        out.flush();
  
        Buffer buffer = in.getPacket(true);
        sequence.set(in.getLastPacketSeq());
        type = buffer.getByteAt(0) & 0xff;
  
        //PAM continue until finish.
        if (type == 0xfe //Switch Request
                || type == 0x00 // OK_Packet
                || type == 0xff) { //ERR_Packet
          return buffer;
        }
        authData = buffer.readRawBytes(buffer.remaining());
      }
    }