Socket: Input/OutputStream

P

puretec

I have the following problem:

a java application (client) should communicate with a sever, where the
communication objects are as follows:

public class Comm_1
{
long lSync;
long lLength;
CData_1 oData1;
}

.....

public class Comm_1
{
long lSync;
long lLength; // length [byte] of the object
CData_n oDatan;
}

1) How can I determine the length of an object in order to assign that value
to o.lLength (I know how to do this by hand);

2) Is the ObjectOutputStream ( linked to the socket.getOutputStream() ) the
stream which I should use for sending the objects?

sincerely
thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top