int num_frags;
try {
// write message into a byte buffer and fragment it
ExposedByteArrayOutputStream out_stream=new ExposedByteArrayOutputStream((int)(size + 50));
ExposedDataOutputStream dos=new ExposedDataOutputStream(out_stream);
msg.writeTo(dos);
byte[] buffer=out_stream.getRawBuffer();
byte[][] fragments=Util.fragmentBuffer(buffer, frag_size, dos.size());
num_frags=fragments.length;
num_sent_frags+=num_frags;
if(log.isTraceEnabled()) {
StringBuilder sb=new StringBuilder();