If you have a service interface Service:
@RemoteServiceRelativePath("service")
public interface Service extends RemoteService {
void send(Message m);
}
You can do the following
Message m = new Message();
// initialize message
SerializationStreamFactory sf = GWT.create(Service.class);
SerializationStreamWriter writer = sf.createStreamWriter();
writer.writeObject(m);
int size = writer.toString().length();
writer.toString() returns the actual serialized Message object.
AFAIK GWT serialization is asymetric so perhaps the size is a bit different
when the Message object is sent from the server to the client.
Hope this helps.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.