int hdrs_size=0;
for(Map.Entry<Short,Header> entry: hdrs.entrySet()) {
Class clazz=ClassConfigurator.getProtocol(entry.getKey());
String name=clazz != null? clazz.getSimpleName() : null;
Header hdr=entry.getValue();
int size=hdr.size();
hdrs_size+=size;
sb.append(name).append(": ").append(" ").append(size).append(" bytes\n");
}
sb.append("headers=").append(hdrs_size).append(", total msg size=").append(msg.size());
sb.append(", msg payload=").append(msg.getLength()).append("\n");