title: Reading an Object type from a binary file
body: <p>So I'm trying to read from a dat file, and store its contents in an ArrayList of type Website (the dat file contains a list of names with URLs to websites as a website object). My question is what do I need to do in order to be able to read from this file? Currently I'm getting a ClassNotFoundException. Here is the code that I have so far:</p>
  
  <pre><code>try
  {
      web = (Website) mediaReader.readObject();
      webster.add(web);
      mediaReader.close();
  } catch(EOFException e)
  {
      more = false;
      System.out.println("File successfully read:");
  }
  </code></pre>
  
  <p>mediaReader is an ObjectInputStream, webster is an arrayList of type Website, and web is an instance of the website class. If you need to see the website class for any reason, I will be happy to show you the code.</p>