The process of saving the object is quite easy, however, it doesn't work for all objects. Object serialization is the process of saving an entire object out to a file. Instead, we can use object serialization to make this easier. However, that's a lot of work just to save and load some objects. If you had a list then you could convert each object to JSON and store them all in a JSON array and store that out as a string. What if you want to save an entire object or list of objects? You could first convert your object to key/value pairs in JSON and save that out. Need to save out and read back in some JSON, XML, or lines of text? File streams and stream readers are perfect for the job. Using file streams to save data out to files works well enough string data.
0 Comments
Leave a Reply. |