serializing and deserializing an object between Unix and Windows

Posted on 2004-04-12
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
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
LVL 86

Accepted Solution

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

Assisted Solution

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!
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):
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.


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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hibernate example using maven 12 110
null output 3 59
Netbeans and org.apache.commons.lang3 issue 3 55
Tomcat 9 + java 8 error while trying to deploy a war file 2 858
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Suggested Courses

751 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