public int serializedSize() { return Global.BYTE_SIZE // type + Bits.size(req_id) // req_id + Global.SHORT_SIZE; // corrId } }
public int serializedSize() { int retval=Global.BYTE_SIZE; if(type == DATA) retval+=Bits.size(seqno); return retval; }
public int serializedSize() { return Global.BYTE_SIZE + Bits.size(seqno) + Global.SHORT_SIZE; } }
public int serializedSize() { return Global.BYTE_SIZE + Bits.size(seqno) + Global.BYTE_SIZE; // type + seqno + flush_ack }
public int serializedSize() { return Bits.size(low, high); }
public int serializedSize() {return Global.BYTE_SIZE + Bits.size(id);}
public final int serializedSize() { int retval=Global.BYTE_SIZE; // type switch(type) { case DATA: retval+=Bits.size(seqno) // seqno + Global.SHORT_SIZE // conn_id + Global.BYTE_SIZE; // first break; case ACK: retval+=Bits.size(seqno) + Global.SHORT_SIZE // conn_id + Bits.size(timestamp); break; case SEND_FIRST_SEQNO: retval+=Bits.size(timestamp); break; case XMIT_REQ: break; case CLOSE: retval+=Global.SHORT_SIZE; // conn-id break; } return retval; }
/** * Computes the size of a variable-length encoded double * @param num the double * @return the number of bytes needed to variable-length encode num */ public static int size(double num) { return size(Double.doubleToLongBits(num)); }
public static int size(String str) { if(str == null) return Global.BYTE_SIZE; byte[] bytes=str.getBytes(); return Global.BYTE_SIZE + size(bytes.length) + bytes.length; }
/** * Computes the size of a variable-length encoded float * @param num the float * @return the number of bytes needed to variable-length encode num */ public static int size(float num) { return size(Float.floatToIntBits(num)); }
public long serializedSize(boolean with_members) { long retval=with_members? Util.size(members) : Global.SHORT_SIZE; for(int i=0; i < members.length; i++) retval+=Bits.size(seqnos[i*2], seqnos[i*2+1]); return retval; }
public int serializedSize() { int retval=Global.BYTE_SIZE; // type switch(type) { case MSG: case XMIT_RSP: case HIGHEST_SEQNO: return retval + Bits.size(seqno); case XMIT_REQ: retval+=Util.size(sender); return retval; } return retval; }
/** The number of bytes required to serialize this instance */ public int serializedSize() {return super.serializedSize() + Bits.size(flags);} public String toString() {
public int serializedSize() { return Bits.size(id) + Util.size(address); }
public int serializedSize() { return Bits.size(id) + Util.size(creator); }