Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


serializing and deserializing an object between Unix and Windows

Posted on 2004-04-12
Medium Priority
Last Modified: 2010-03-31

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?

Question by:TheDownsizer
LVL 86

Accepted Solution

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

Assisted Solution

int_20h earned 80 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!
LVL 14

Assisted Solution

by:Tommy Braas
Tommy Braas earned 80 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
Industry Leaders: 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

ID: 10813747
Thanks for the help.
LVL 86

Expert Comment

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
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! :-)
LVL 86

Expert Comment

ID: 10817357
1.3 -> 1.4 is OK
1.3 -> 1.5 is OK

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month11 days, 17 hours left to enroll

564 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