Implementing an XDR DataInputStream / DataOutputStream

From: Alexandros Karypidis (karypid_at_inf.uth.nospam.gr)
Date: 03/24/04


Date: Wed, 24 Mar 2004 18:27:59 +0200

Hi all,

I would like some advice regarding the following design issue:

I would like to be able to exchange data in XDR format. I was thinking of
writing a pair of I/O streams in the same fashion as DataInputStream and
DataOutputStream. I am ambivalent as to whether I should:

(a) subclass DataInputStream / DataOutputStream and override what is needed
(b) subclass FilterInputStream / FilterOutputStream and implement the
DataInput / DataOutput interfaces.

The option (b) is how DataInputStream / DataOutputStream are implemented. On
the other hand, option (a) would allow my streams to be used as a drop-in
replacement for code written with DataInputStream / DataOutputStream.

-- 
In theory, there is no difference between theory and practice.
In practice, there is. -- Yogi Berra.
Alexandros Karypidis
University of Thessaly
Computer & Communications Engineering dept.


Relevant Pages

  • Re: Recognizing when a Socket connection goes away.
    ... > talking to each other using DataInputStream and DataOutputStream. ... > recognize when the server connection ends. ... all have ways of indicating EOF, ...
    (comp.lang.java.programmer)
  • Re: InputStream des Sockets blockiert bei read()
    ... Ich habe nun meinen InputStream und OutputStream zu einem DataInputStream ... os = new DataOutputStream(con.openOutputStream()); ... // response empfangen ... String response = is.readUTF; ...
    (de.comp.lang.java)
  • Re: Question on C/C++ and Java TCP/IP
    ... > Chris Smith wrote: ... >> As for how to do that, it involves DataInputStream and DataOutputStream ... The standard socket routines along the lines of htonlwill ...
    (comp.lang.java.programmer)
  • Re: Question on C/C++ and Java TCP/IP
    ... > Chris Smith wrote: ... >> As for how to do that, it involves DataInputStream and DataOutputStream ... The standard socket routines along the lines of htonlwill ...
    (comp.lang.java.programmer)