RFR: 8358623: Avoid unnecessary data copying in ICC_Profile

Sergey Bylokhov serb at openjdk.org
Thu Jun 12 18:10:40 UTC 2025


On Thu, 12 Jun 2025 05:26:54 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:

> [verifyHeader(byte[] data)](https://github.com/openjdk/jdk/blob/3b32f6a8ec37338764d3e6713247ff96e49bf5b3/src/java.desktop/share/classes/java/awt/color/ICC_Profile.java#L1176C2-L1184C6), expects header byte array and not the entire profile array, is it technically correct to send the entire profile byte array?

Validating the header directly without cloning is fine and actually better. The old code effectively skipped the "header.length < HEADER_SIZE" check because it always created a "new byte[HEADER_SIZE]".

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25650#discussion_r2143354144


More information about the client-libs-dev mailing list