ExposedByteArrayOutputStream out_stream=new ExposedByteArrayOutputStream((int)(msg.size() + 50));
ExposedDataOutputStream dos=new ExposedDataOutputStream(out_stream);
writeMessage(msg, dos, multicast);
Buffer buf=new Buffer(out_stream.getRawBuffer(), 0, out_stream.size());
if(stats) {
num_msgs_sent++;
num_bytes_sent+=buf.getLength();
}
List<RouterStub> stubs = stubManager.getStubs();
if(multicast) {
tunnel_policy.sendToAllMembers(stubs, group, buf.getBuf(), buf.getOffset(), buf.getLength());
}
else {
tunnel_policy.sendToSingleMember(stubs, group, dest, buf.getBuf(), buf.getOffset(), buf.getLength());
}
}