code: public Buffer process(PacketOutputStream out, PacketInputStream in, AtomicInteger sequence) throws IOException {
      if (password == null || password.isEmpty()) {
        out.writeEmptyPacket(sequence.incrementAndGet());
      } else {
        out.startPacket(sequence.incrementAndGet());
        byte[] bytePwd;
        if (passwordCharacterEncoding != null && !passwordCharacterEncoding.isEmpty()) {
          bytePwd = password.getBytes(passwordCharacterEncoding);
        } else {
          bytePwd = password.getBytes();
        }
        out.write(bytePwd);
        out.write(0);
        out.flush();
      }
  
      Buffer buffer = in.getPacket(true);
      sequence.set(in.getLastPacketSeq());
      return buffer;
  
    }
docs: Send password in clear text to server.
  
  @param out       out stream
  @param in        in stream
  @param sequence  packet sequence
  @return response packet
  @throws IOException  if socket error