[413] in java-interest
Re: writing "structures" to streams...
daemon@ATHENA.MIT.EDU (Steve Dossick)
Tue Jun 20 14:49:52 1995
To: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
Cc: sdossick@opus.cs.columbia.edu, java-interest@java.Eng.Sun.COM
In-Reply-To: Your message of "Tue, 20 Jun 1995 11:25:22 PDT."
<9506201825.AA13280@acorn.Eng.Sun.COM>
Date: Tue, 20 Jun 1995 14:30:00 -0400
From: Steve Dossick <sdossick@cs.columbia.edu>
In message <9506201825.AA13280@acorn.Eng.Sun.COM>, Arthur van Hoff writes:
>
> Hi Steve,
>
> The best way of solving it is to add a write(DataOutputStream out)
> method to the instance in question and write the fields out explicitly.
> You would also need a constructor that can reconstruct the object
> from a DataInputStream. That would be portable.
>
> Note that java has a modifier called "transient". This is supposed
> to be used during persitification of instances. This has not been
> implemented.
>
I had thought of deriving a class from Object, and adding a method which
could use the ObjectScope class to write out any object in the way you
would get in C by calling write(). Unfortunately, you'd be interpreting
the format of each object every time it was written, so the performance
would be gross.
Thanks for your quick response!
/steve
------------------------------------------------------------------------------
Steve Dossick
Central Research Facilities
Department of Computer Science
Columbia University
(sdossick@cs.columbia.edu)
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com