public static void testBufferSize() throws Exception {
int a=10;
String b="Bela";
MethodCall m=new MethodCall("foo", new Object[]{new Integer(a),b}, new Class[]{int.class, String.class});
ByteArrayOutputStream msg_data=new ByteArrayOutputStream();
ObjectOutputStream msg_out=new ObjectOutputStream(msg_data);
m.writeExternal(msg_out);
msg_out.flush();
msg_out.close();
byte[] data=msg_data.toByteArray();
ByteArrayInputStream msg_in_data=new ByteArrayInputStream(data);
ObjectInputStream msg_in=new ObjectInputStream(msg_in_data);
MethodCall m2=new MethodCall();
m2.readExternal(msg_in);
System.out.println(m2.getName());
System.out.println(m2.getArgs().length);
}