File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
src/java.desktop/share/classes Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 5757import sun .java2d .cmm .ProfileDataVerifier ;
5858import sun .java2d .cmm .ProfileDeferralInfo ;
5959
60+ import static sun .java2d .cmm .ProfileDataVerifier .HEADER_SIZE ;
61+
6062/**
6163 * A representation of color profile data for device independent and device
6264 * dependent color spaces based on the International Color Consortium
@@ -764,8 +766,6 @@ private interface BuiltInProfile {
764766 */
765767 public static final int icXYZNumberX = 8 ;
766768
767- private static final int HEADER_SIZE = 128 ;
768-
769769 /**
770770 * Constructs an {@code ICC_Profile} object with a given ID.
771771 */
@@ -913,11 +913,11 @@ public static ICC_Profile getInstance(InputStream s) throws IOException {
913913
914914 static byte [] getProfileDataFromStream (InputStream s ) throws IOException {
915915 BufferedInputStream bis = new BufferedInputStream (s );
916- bis .mark (128 ); // 128 is the length of the ICC profile header
916+ bis .mark (HEADER_SIZE );
917917
918- byte [] header = bis .readNBytes (128 );
919- if (header .length < 128 || header [36 ] != 0x61 || header [ 37 ] != 0x63 ||
920- header [38 ] != 0x73 || header [39 ] != 0x70 ) {
918+ byte [] header = bis .readNBytes (HEADER_SIZE );
919+ if (header .length < HEADER_SIZE || header [36 ] != 0x61 ||
920+ header [37 ] != 0x63 || header [ 38 ] != 0x73 || header [39 ] != 0x70 ) {
921921 return null ; /* not a valid profile */
922922 }
923923 int profileSize = intFromBigEndian (header , 0 );
Original file line number Diff line number Diff line change 11/*
2- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
@@ -106,7 +106,7 @@ private static int readInt32(byte[] data, int off) {
106106 */
107107 private static final int MAX_TAG_COUNT = 100 ;
108108
109- private static final int HEADER_SIZE = 128 ;
109+ public static final int HEADER_SIZE = 128 ;
110110 private static final int TOC_OFFSET = HEADER_SIZE + 4 ;
111111 private static final int TOC_RECORD_SIZE = 12 ;
112112
You can’t perform that action at this time.
0 commit comments