Solved

serializing and deserializing an object between Unix and Windows

Posted on 2004-04-12
7
258 Views
Last Modified: 2010-03-31
Experts,

I would like to produce data files that can be shared by servers implemented in Java that are running on Unix and Windows without having to fuss with endianness if possible. Is there a method/object Java provides where an object can be serialized/deserialized on a big endian platform and deserialized/serialized on a little endian platform seamlessly?

Thanks.
0
Comment
Question by:TheDownsizer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 10808687
Java uses the same byte order on any platform. readObject/writeObject won't be affected by host byte order
0
 
LVL 3

Assisted Solution

by:int_20h
int_20h earned 20 total points
ID: 10808777
Serialization/Deserialization can happen in any platform as long as the same version of the jdk/jre are used...  For instance v.1.1 and 1.2 will not work.  As far as I know 1.3 and 1.4 should be fine!
0
 
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 20 total points
ID: 10809015
You need to make sure that the JDKs/JREs being used are using the same class version! Class version differences and/or incompatibilities will cause errors and failures. See here for more information (including all previous versions of Java): http://java.sun.com/j2se/1.4/compatibility.html
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:TheDownsizer
ID: 10813747
Thanks for the help.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10813797
:-)

>>Class version differences and/or incompatibilities will cause errors and failures.

That's actually only the case for backward compatibility. Something serialized in 1.4 will deserialize OK in 1.5
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 10815338
=-)

>> That's actually only the case for backward compatibility.
Not true. Read the comments in the Swing classes for instance. No guarantees are made regarding backward or forward compatibility of any class, ever.

>> Something serialized in 1.4 will deserialize OK in 1.5
Good to know. And lucky too! :-)
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10817357
1.3 -> 1.4 is OK
1.3 -> 1.5 is OK
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java exception bubble up 2 24
String array comparison 4 45
Which non-HTML GUI front end to use with Java? 3 51
collection output issue 9 59
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question