Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Serializable, Do I really need it?  RSS feed

 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm reading and writing to files - the text size is normally 200-300 words when reading/writing to a file, it is in 'String' format.

My question is, do I need to use serialization for such an i/o operation?

Also when would I benefit from using serialization?

Thanks in advance for your thoughts, Regards
Zein
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The purpose of serialization is to save arbitrary trees objects in a convenient form so that you can recreate that same tree of objects at some other time. If you're just saving text, then no, of course, you don't need serialization. Text is a perfectly lovely file format.
 
Zein Nunna
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Ernest, much appreciated.

Regards
Zein
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!