src/share/classes/com/sun/imageio/plugins/common/ImageUtil.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -591,20 +591,19 @@
                 for(int y = 0; y < rectHeight; y++) {
                     int xRemaining = rectWidth;
                     int i = eltOffset;
                     while(xRemaining > 24) {
                         data[i++] =
-                            (int)(((binaryDataArray[b++] & 0xFF) << 24) |
+                            (((binaryDataArray[b++] & 0xFF) << 24) |
                                   ((binaryDataArray[b++] & 0xFF) << 16) |
                                   ((binaryDataArray[b++] & 0xFF) << 8) |
                                   (binaryDataArray[b++] & 0xFF));
                         xRemaining -= 32;
                     }
                     int shift = 24;
                     while(xRemaining > 0) {
-                        data[i] |=
-                            (int)((binaryDataArray[b++] & 0xFF) << shift);
+                        data[i] |= ((binaryDataArray[b++] & 0xFF) << shift);
                         shift -= 8;
                         xRemaining -= 8;
                     }
                     eltOffset += lineStride;
                 }

@@ -833,12 +832,11 @@
             for(int y = 0; y < rectHeight; y++) {
                 int bOffset = eltOffset*32 + bitOffset;
                 for(int x = 0; x < rectWidth; x++) {
                     if(bdata[k++] != (byte)0) {
                         data[bOffset/32] |=
-                            (int)(0x00000001 <<
-                                  (31 - bOffset % 32));
+                            (0x00000001 << (31 - bOffset % 32));
                     }
                     bOffset++;
                 }
                 eltOffset += lineStride;
             }