Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Serialized object size

Status
Not open for further replies.

McBugzz

Programmer
Sep 17, 2002
90
0
0
JP
I'm calling a remote method (ejb) and as an argument I pass a Serializable Object. The object is a model which has references to other objects (and so forth). Is there a way to measure the exact size of the marshalled data that's going to be actually sent over the net?

If yes, please give a hint how.
 
Or just write it to a ByteArrayOutputStream, and then use then do :

byte[] data = baos.toByteArray();
int iSize = data.length;

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
That simple? I mean, there's the MarshalledObject class that seems to do the job and can tell the objBytes.lenght, but I though that maybe there's some king of a profiler that track that...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top