GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes serialize object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "serialize object" Watch "serialize object" New topic
Author

serialize object

abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
Objects can be serialized to disk on a single machine or can be serialized across a network
such as the Internet, even in a case in which different operating systems are
involved. You can create an object on a Windows machine, serialize it to a Linux
machine, and load it back into the original Windows machine without error


In real world, May you give me one scenario about " create an object on a Windows machine, serialize it to a Linux
machine" ?

The second question:"or can be serialized across a network
such as the Internet,"

When a file is serialized to disk, It is understandable, But How "serialized across a network
such as the Internet"?



Thakur Sachin Singh
Ranch Hand

Joined: Jun 15, 2010
Posts: 232

file serialize on network means....file serialize to any machine which attach to network.


SCJP 6- 91%, IBM DB2, IBM RAD Certified
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14196
    
  20

Serializing an object means converting it to a stream of bytes that you can later convert back to a Java object (deserializing). You can do anything with that stream of bytes you like: store it in a file on disk, or transmit them across a network, etc.

"Serialize across a network" means: serializing an object (converting it into a stream of bytes) and sending those bytes over a network to another computer (where the bytes can be deserialized back into an object).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
abalfazl hossein
Ranch Hand

Joined: Sep 06, 2007
Posts: 635
Firefox and google chrome can restore all web pages after closing.

Do they use serialize?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14196
    
  20

Firefox and Google Chrome are not Java programs. So they certainly do not do serialization the Java way. If you'd want to know how these browsers store information about which tabs are open, you'd have to look in the source code. It could be something like serialization, but it could just as well be something entirely different. Just because some program saves settings, you can't say from the outside, without knowing how the code works, if it is using something like serialization or not.
 
GeeCON Prague 2014
 
subject: serialize object