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); }
public static int getPayloadStart(TerminusMessage m) { return ID_START + m.getID().length() + 1; }