On Wed, 24 Jun 2026 14:36:39 GMT, Alexey Semenyuk <[email protected]> wrote:

>> src/jdk.jpackage/windows/classes/jdk/jpackage/internal/RtfConverter.java 
>> line 51:
>> 
>>> 49:             byte[] firstBits = new byte[7];
>>> 50: 
>>> 51:             if (fin.read(firstBits) == firstBits.length) {
>> 
>> Shouldn't we use `fin.readNBytes` here?
>> or `Files.newInputStream` always read at least 7 bytes?
>
> `fin.read(firstBits)` reads at most 7 bytes.

I mean, could it read 5 bytes, when file is 10 bytes?
Code expects that 7 bytes will be read for sure.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30904#discussion_r3469392084

Reply via email to