4 + (replyAddress == null ? 0 : replyAddress.length()) +
getBodyLength();
Buffer totBuff = new Buffer(length);
totBuff.appendInt(0);
totBuff.appendByte(type());
totBuff.appendByte(send ? (byte)0 : (byte)1);
writeString(totBuff, address);
totBuff.appendInt(sender.port);
writeString(totBuff, sender.host);
if (replyAddress != null) {
writeString(totBuff, replyAddress);