code: public static ImageInfo read(InputStream in) throws IOException {
          ImageInfo imageInfo = new ImageInfo();
          imageInfo.setInput(in);
          if (!imageInfo.check()) {
              throw new IOException("ImageInfo.check() failed; data stream is "
                      + "broken or does not contain data in a supported image format");
          }
          return imageInfo;
      }
docs: Reads image info from a stream.
  @param in the input stream containing image data
  @return the image info object, with {@link ImageInfo#check() }
  already invoked
  @throws IOException if {@link ImageInfo#check() } fails or any other
  I/O exception is thrown