title: Serializing/Deserializing buffered images
body: <p>I have a collection of buffered images that I want to serialize and then deserialize.
  For example I have an arrayList full of buffered images which are iterated through and written to a
  ObjectOutputStream</p>
  
  <pre><code>for (BufferedImages i : images{
  
  ImageIO.write(i,"png",ImageIO.createImageOutputStream(output));
  
  }
  </code></pre>
  
  <p>When I go to re-serialize the  images, I tried to use</p>
  
  <pre><code> BufferedImage image =ImageIO.read(ImageIO.createImageInputStream(input)); 
  </code></pre>
  
  <p>but it only reads in one image.</p>
  
  <p>Whats the correct way to re-serialize a collection of buffered images stored within the same serialized file?</p>
  
  <p>Also once the images have been re-serialized they get redrawn to a JLabel,
  How do I know which image is the correct one for each JLabel?</p>