object stream format

L

Larry

Is there any documentation on Java's object stream format or any tools
to display it in a readable format and/or create them?
 
L

Larry

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



Simply serialize an object in Java?

Yes, if I am using Java. But I want to process the object stream from
another language (Perl).
 
T

Timo Stamm

Larry said:
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.
 
T

Thomas Hawtin

Timo said:
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.

Or load a JVM from within Perl?

Tom Hawtin
 
C

Chris Uppal

Timo said:
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
 
L

Larry

Timo said:
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.
 
T

Timo Stamm

Larry said:
Timo Stamm wrote:
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
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top