On Tue, 24 May 2022 01:28:29 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> Martin Desruisseaux has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Test all plugins, not only "BMP".
>
> src/java.desktop/share/classes/com/sun/imageio/plugins/common/ReaderUtil.java 
> line 284:
> 
>> 282:         } while (offset < b.length);
>> 283:         return true;
>> 284:     }
> 
> Any reason not to catch EOFException exception in the exceptional situation?

No strong reason. I thought it was safer because a -1 return value means that 
the stream reached EOF on normal condition, while `EOFException` could still be 
a problem with the stream for example if the stream wraps another `InputStream` 
for applying decompression on-the-fly (e.g. a ZIP file), and the compressed 
stream is truncated before the end of the compression chunk.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8700

Reply via email to