Exemple #1
0
  public static void putMessageHeader(TerminusMessage message, ByteArrayOutputStream messageOS)
      throws IOException {
    // Place older for length
    messageOS.write(0);
    messageOS.write(0);
    messageOS.write(0);
    messageOS.write(0);

    /* Message Type */
    messageOS.write(getIntArray((message.getMessageType())));

    /* ID */
    LowLevelHelper.writeString(message.getID(), messageOS);
  }
Exemple #2
0
 public static int getPayloadStart(TerminusMessage m) {
   return ID_START + m.getID().length() + 1;
 }