Socket: Input/OutputStream

Discussion in 'Java' started by puretec, Dec 22, 2004.

  1. puretec

    puretec Guest

    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
    puretec, Dec 22, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas

    Socket Input-/Outputstream

    Thomas, Dec 22, 2004, in forum: Java
    Replies:
    3
    Views:
    363
    Steve Horsley
    Dec 23, 2004
  2. Replies:
    6
    Views:
    1,194
  3. Replies:
    2
    Views:
    3,572
  4. Replies:
    2
    Views:
    590
  5. Laszlo Nagy
    Replies:
    1
    Views:
    4,769
    Mark Wooding
    Jan 27, 2009
Loading...

Share This Page