/** * Returns the exact size of the marshalled message. Uses method size() of each header to compute * the size, so if a Header subclass doesn't implement size() we will use an approximation. * However, most relevant header subclasses have size() implemented correctly. (See * org.jgroups.tests.SizeTest). * * @return The number of bytes for the marshalled message */ public long size() { long retval = Global.BYTE_SIZE // leading byte + Global.SHORT_SIZE; // flags if (dest_addr != null) retval += Util.size(dest_addr); if (src_addr != null) retval += Util.size(src_addr); if (buf != null) retval += Global.INT_SIZE // length (integer) + length; // number of bytes in the buffer retval += Global.SHORT_SIZE; // number of headers retval += headers.marshalledSize(); return retval; }
@Override public int size() { return (int) (Global.BYTE_SIZE + messageID.serializedSize() + Bits.size(sequencerNumber) + Util.size(destinations)); }
public final int size() { int retval = Global.BYTE_SIZE; // type switch (type) { case DATA: retval += Util.size(seqno) // seqno + Global.SHORT_SIZE // conn_id + Global.BYTE_SIZE; // first break; case ACK: retval += Util.size(seqno) + Global.SHORT_SIZE; // conn_id break; case SEND_FIRST_SEQNO: retval += Util.size(seqno); break; } return retval; }
public int size() { int retval = Global.BYTE_SIZE * 2; // type + merge_rejected retval += Global.BYTE_SIZE; // presence view retval += Global.BYTE_SIZE; // MergeView or View if (view != null) retval += view.serializedSize(); retval += Util.size(mbr); retval += Util.size(mbrs); retval += Global.BYTE_SIZE; // presence of join_rsp if (join_rsp != null) retval += join_rsp.serializedSize(); retval += Global.BYTE_SIZE; // presence for my_digest if (my_digest != null) retval += my_digest.serializedSize(); retval += Global.BYTE_SIZE; // presence for merge_id if (merge_id != null) retval += merge_id.size(); retval += Global.BYTE_SIZE; // boolean useFlushIfPresent return retval; }
public int serializedSize() { return (int) (vid.serializedSize() + Util.size(members)); }
public int size() { return Util.size(fork_stack_id) + Util.size(fork_channel_id); }
public int size() { return Util.size(encryptedToken); }