Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

object stream format

Thread view: 
Larry - 09 Mar 2006 21:25 GMT
Is there any documentation on Java's object stream format or any tools
to display it in a readable format and/or create them?
Thomas Fritsch - 09 Mar 2006 21:47 GMT
> Is there any documentation on Java's object stream format

See http://java.sun.com/j2se/1.4/pdf/serial-spec.pdf (Chapter 6: Object
Serialization Protocol)

> or any tools
> to display it in a readable format and/or create them?

Signature

"TFritsch$t-online:de".replace(':','.').replace('$','@')

Timo Stamm - 09 Mar 2006 22:00 GMT
Larry schrieb:
> Is there any documentation on Java's object stream format

Yes:

http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/protocol.html#8101

> or any tools to display it in a readable format

Isn't it easier to deserialize in Java and use Reflection and toString()
to print it?

> and/or create them?

Simply serialize an object in Java?

Timo
Larry - 10 Mar 2006 16:36 GMT
> Isn't it easier to deserialize in Java and use Reflection and toString()
> to print it?
>
> > and/or create them?
>
> Simply serialize an object in Java?

Yes, if I am using Java.  But I want to process the object stream from
another language (Perl).
Timo Stamm - 10 Mar 2006 16:44 GMT
Larry schrieb:
>> Isn't it easier to deserialize in Java and use Reflection and toString()
>> to print it?
[quoted text clipped - 4 lines]
> Yes, if I am using Java.  But I want to process the object stream from
> another language (Perl).

Sounds like a lot of pain. I would avoid this under all circumstances
and rather use a serialization protocol that is available in both languages.
Thomas Hawtin - 10 Mar 2006 19:05 GMT
> Larry schrieb:
>>
[quoted text clipped - 4 lines]
> and rather use a serialization protocol that is available in both
> languages.

Or load a JVM from within Perl?

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Chris Uppal - 10 Mar 2006 19:23 GMT
> > Yes, if I am using Java.  But I want to process the object stream from
> > another language (Perl).
>
> Sounds like a lot of pain. I would avoid this under all circumstances
> and rather use a serialization protocol that is available in both
> languages.

Especially since the serialisation may involve custom Java code.

I.e. the problem is not solvable in general.  Many specific cases can be solved
by this approach, but it's not clear that reducing the problem that far doesn't
also bring other solutions into play.  XML ?  YAML ?

   -- chris
Larry - 12 Mar 2006 14:42 GMT
> Larry schrieb:
> >> Isn't it easier to deserialize in Java and use Reflection and toString()
[quoted text clipped - 8 lines]
> Sounds like a lot of pain. I would avoid this under all circumstances
> and rather use a serialization protocol that is available in both languages.

I am only in control of the client Perl script.  I can't change the
server code.  The server code expects to receive a Java object stream
from the client (which is supposed to be an applet).

I already have a bunch of Perl client scripts in place.  I don't want
to add a JVM as a dependency just for this one object stream.

I have no pretenses of this solution being part of a cohesive system
architecture.  This is a hack for sure.  But there is a place for
hacks, imho.
Timo Stamm - 12 Mar 2006 16:28 GMT
Larry schrieb:
> I am only in control of the client Perl script.  I can't change the
> server code.

I hope you can at least use the source of the server code for debugging.

> The server code expects to receive a Java object stream
> from the client (which is supposed to be an applet).

Using Java to create the stream seems to be the best option, then. You
simple create the objects and call a method to serialize them to a
stream. It is very straight-forward.

> I already have a bunch of Perl client scripts in place.  I don't want
> to add a JVM as a dependency just for this one object stream.
> This is a hack for sure.  But there is a place for
> hacks, imho.

Sure there is, but be warned that under these circumstances, it's not a
hack, it's a *MAJOR HACK*. I only allow myself to use hacks if they save
me a lot of time.

In your case, you have to options:

a)
- learn some basic java
- have a dependency on a jre in your client

b)
- learn a lot about the java serialization protocol
- setup a testing environment
- have a component in the client that is very difficult to maintain and
extend

I just don't think b) will save you time.

Timo


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.