• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Serialize and Serialization

 
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone care to explain to me this concept?
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Serialization refers to the idea that any object can be written (with its current state) to a file, a socket...any stream. You could take any object (not the class, but an actual instantiation) and blast it across the Internet if you wanted.
Just make sure that the class from which the object is instantiated "implements Serializable". This is just a "marker" interface meaning you do not have to implement any methods. It has no methods to be implemented.
Look at the ObjectStream classes for reading and writing objects this way.
Maybe any of the real experts on the Java Ranch can amplify this comment.
Mark
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at http://java.sun.com/docs/books/tutorial/essential/io/serialization.html
 
Paulo Aquino
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Serialization refers to the idea that any object can be written (with its current state) to a file, a socket...any stream. You could take any object (not the class, but an actual instantiation) and blast it across the Internet if you wanted.
Just make sure that the class from which the object is instantiated "implements Serializable". This is just a "marker" interface meaning you do not have to implement any methods. It has no methods to be implemented.
Look at the ObjectStream classes for reading and writing objects this way.
Maybe any of the real experts on the Java Ranch can amplify this comment.
Mark


Hey mark thanks for that insightful reply!
 
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic