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);