Skip to main content

ImageIO.read()

1 reply [Last post]
mc2718
Offline
Joined: 2010-02-14
Points: 0

Apologies if this is not the most appropriate forum - I could not figure out which one would be.

Can anyone point me to some *documentation* on what the final stream position is after ImageIO.read(InputStream) returns? Writing two successive images with ImageIO.write(...) onto the same stream works (I checked the output using hexdump), but reading the two images back fails for some reason.

The documentation at http://java.sun.com/j2se/1.5.0/docs/api/index.html?javax/imageio/ImageIO...
is unfortunately insufficient.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mc2718
Offline
Joined: 2010-02-14
Points: 0

After some experimentation, it looks like reading stops before the last 16 bytes of the PNG files I wrote with imageio.write().

If anybody from Sun is reading this, I would like to know the reason behind this particular choice, where it is documented, and whether this is a design feature for future Java versions as well.