title: ImageIO.read closes inputs stream
body: <p>I write images and other data to binary file. When I read image via ImageIO.read(InputStream) from that file, it reads image, it is ok, but method closes given input stream and I cant proceed to read other data.</p>
  
  <ol>
  <li>Why so it is made?</li>
  <li>Then how read image without closing stream?</li>
  </ol>
  
  <p><strong>EDIT</strong>: It is simple code that writes image and string after into file:</p>
  
  <pre><code>File f = new File("test.bin");
  if(f.exists())
  f.delete();
  f.createNewFile();
  DataOutputStream os = new DataOutputStream(new FileOutputStream(f));
  BufferedImage img = ImageIO.read(new File("test.jpg"));
  ImageIO.write(img, "jpg", os);
  os.writeUTF("test string after image");
  os.close();
  </code></pre>
  
  <p>And code that reads all:</p>
  
  <pre><code>DataInputStream is = new DataInputStream(new FileInputStream(f));
  BufferedImage img = ImageIO.read(is);
  String s = is.readUTF(); // on this line EOFException occurs
  System.out.println(s);
  </code></pre>
  
  <p>NetBeans output:</p>
  
  <pre><code>Exception in thread "main" java.io.EOFException
  at java.io.DataInputStream.readUnsignedShort(DataInputStream.java:340)
  at java.io.DataInputStream.readUTF(DataInputStream.java:589)
  at java.io.DataInputStream.readUTF(DataInputStream.java:564)
  at mediamanager.Main.test(Main.java:105)
  at mediamanager.Main.main(Main.java:44)
  </code></pre>
  
  <p>May be I'm doing something wrong?</p>