Beispiel #1
0
  @Override
  public void authenticate(String response) throws IOException {

    DataOutputStream out = beginMessage();

    out.writeCString(response);

    endMessage(PASSWORD_MSG_ID);
  }
Beispiel #2
0
  void startup(short protoVersionMajor, short protoVersionMinor, Map<String, Object> params)
      throws IOException {

    DataOutputStream out = beginMessage((char) 0);

    // Version
    out.writeShort(protoVersionMajor);
    out.writeShort(protoVersionMinor);

    // Name=Value pairs
    for (Map.Entry<String, Object> paramEntry : params.entrySet()) {
      out.writeCString(paramEntry.getKey());
      out.writeCString(paramEntry.getValue().toString());
    }

    endMessage((char) 0);
  }
Beispiel #3
0
 private DataOutputStream beginMessage(byte code) throws IOException {
   messageOut.reset();
   messageDataOut.writeByte(code);
   messageDataOut.writeInt(-1);
   return messageDataOut;
 }