in core/src/main/java/flex/messaging/messages/AbstractMessage.java [348:420]
public void writeExternal(ObjectOutput output) throws IOException {
short flags = 0;
if (clientIdBytes == null && clientId != null && clientId instanceof String)
clientIdBytes = UUIDUtils.toByteArray((String) clientId);
if (messageIdBytes == null && messageId != null)
messageIdBytes = UUIDUtils.toByteArray(messageId);
if (body != null)
flags |= BODY_FLAG;
if (clientId != null && clientIdBytes == null)
flags |= CLIENT_ID_FLAG;
if (destination != null)
flags |= DESTINATION_FLAG;
if (headers != null)
flags |= HEADERS_FLAG;
if (messageId != null && messageIdBytes == null)
flags |= MESSAGE_ID_FLAG;
if (timestamp != 0)
flags |= TIMESTAMP_FLAG;
if (timeToLive != 0)
flags |= TIME_TO_LIVE_FLAG;
if (clientIdBytes != null || messageIdBytes != null)
flags |= HAS_NEXT_FLAG;
output.writeByte(flags);
flags = 0;
if (clientIdBytes != null)
flags |= CLIENT_ID_BYTES_FLAG;
if (messageIdBytes != null)
flags |= MESSAGE_ID_BYTES_FLAG;
if (flags != 0)
output.writeByte(flags);
if (body != null)
writeExternalBody(output);
if (clientId != null && clientIdBytes == null)
output.writeObject(clientId);
if (destination != null)
output.writeObject(destination);
if (headers != null)
output.writeObject(headers);
if (messageId != null && messageIdBytes == null)
output.writeObject(messageId);
if (timestamp != 0)
output.writeObject(new Long(timestamp));
if (timeToLive != 0)
output.writeObject(new Long(timeToLive));
if (clientIdBytes != null)
output.writeObject(clientIdBytes);
if (messageIdBytes != null)
output.writeObject(messageIdBytes);
}