title: Saving class to file?
body: <p>I am writing a program that is a music player and a lyrics finder. As of now, each time the program loads it has to read each music file and retrieve the ID3 tag to find the artist name, song name, etc. When reading more than a couple files, the process to extract the ID3 tags is very time-consuming. I want to be able to save the ID3 information to my program's private data directory instead of reading each ID3 tag each time the program is ran.</p>
  
  <p>I am confused on serialization and saving/loading something like this. I am guessing I should be using FileOutput/InputStreams or ObjectOutput/InputStreams to achieve this, but I cannot grasp them. Can someone help me out and show me how to save and load my "Song" class correctly? Below are the variables that I need to be able to save.</p>
  
  <pre><code>public class Song implements Serializable
  {
      private int index = 0, trackLength = 0;
      private Bitmap albumArtwork = null;
      private String toString, name, trackNumber, artist, album, lyrics, fileName, releaseDate;
  }
  </code></pre>
  
  <p>As you can see, I need to keep track of some Strings, two ints, and a Bitmap. Can someone show me the setup of how to save an <b>array</b> or <b>ArrayList</b> of these to a file, say, named "music_info.sav" or something along those lines? Also, how can you check if this file exists (and if it does not, create the file as empty)?</p>