code: public String encodeAuthAmqPlain(String username, String password)
      {
  
          AmqpBuffer bytes = new AmqpBuffer();       
          bytes.putShortString("LOGIN");
          bytes.putTypeIdentifier("Longstr");
          bytes.putLongString(username);
  
          bytes.putShortString("PASSWORD");
          bytes.putTypeIdentifier("Longstr");
          bytes.putLongString(password);
          bytes.flip();
  
          int len = bytes.remaining();
          StringBuilder builder = new StringBuilder();
          for (int i = 0; i < len; i++)
          {
              builder.append((char)(bytes.getUnsigned()));
          }
          String s = builder.toString();
          return s;
      }
docs: Encodes the AMQPLAIN authentication response as an AmqpArguments