|
67 | 67 |
|
68 | 68 | import com.sun.imageio.plugins.common.I18N; |
69 | 69 | import com.sun.imageio.plugins.common.ImageUtil; |
| 70 | +import com.sun.imageio.plugins.common.ReaderUtil; |
70 | 71 |
|
71 | 72 | /** This class is the Java Image IO plugin reader for BMP images. |
72 | 73 | * It may subsample the image, clip the image, select sub-bands, |
@@ -1542,9 +1543,8 @@ private void readRLE8(byte[] bdata) throws IOException { |
1542 | 1543 | } |
1543 | 1544 |
|
1544 | 1545 | // Read till we have the whole image |
1545 | | - byte[] values = new byte[imSize]; |
1546 | | - int bytesRead = 0; |
1547 | | - iis.readFully(values, 0, imSize); |
| 1546 | + byte[] values = ReaderUtil. |
| 1547 | + staggeredReadByteStream(iis, imSize); |
1548 | 1548 |
|
1549 | 1549 | // Since data is compressed, decompress it |
1550 | 1550 | decodeRLE8(imSize, padding, values, bdata); |
@@ -1726,8 +1726,8 @@ private void readRLE4(byte[] bdata) throws IOException { |
1726 | 1726 | } |
1727 | 1727 |
|
1728 | 1728 | // Read till we have the whole image |
1729 | | - byte[] values = new byte[imSize]; |
1730 | | - iis.readFully(values, 0, imSize); |
| 1729 | + byte[] values = ReaderUtil. |
| 1730 | + staggeredReadByteStream(iis, imSize); |
1731 | 1731 |
|
1732 | 1732 | // Decompress the RLE4 compressed data. |
1733 | 1733 | decodeRLE4(imSize, padding, values, bdata); |
|
0 commit comments