title: How to count number of objects stored in a *.ser file
body: <p>I'm trying to read all the objects stored in a *.ser file and store them in a array of objects. How can I get the number of objects stored in that file(So that I can declare the array to be <code>number_of_objects</code> long)?</p>
  
  <p>I've checked the API and was unable to find a Desirable function.</p>
  
  <p>-edit-<br>
  A Part of the code:</p>
  
  <pre><code>Ser[] objTest2 = new Ser[number_of_objects];
  for(int i=0; i&lt;=number_of_objects, i++) {
      objTest2[i] = (Ser)testOS2.readObject();
      objTest2[i].printIt(); 
  }
  </code></pre>