kinow commented on a change in pull request #47: IMAGING-134: Fix JPEG handling 
for files encoded with RST markers
URL: https://github.com/apache/commons-imaging/pull/47#discussion_r291792933
 
 

 ##########
 File path: 
src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegInputStream.java
 ##########
 @@ -15,31 +15,39 @@
 
 package org.apache.commons.imaging.formats.jpeg.decoder;
 
-import java.io.IOException;
-import java.io.InputStream;
-
 import org.apache.commons.imaging.ImageReadException;
 import org.apache.commons.imaging.formats.jpeg.JpegConstants;
 
 class JpegInputStream {
     // Figure F.18, F.2.2.5, page 111 of ITU-T T.81
-    private final InputStream is;
+    private final int[] interval;
+    // next position in the array to read
+    private int nextPos;
     private int cnt;
     private int b;
 
-    JpegInputStream(final InputStream is) {
-        this.is = is;
+    JpegInputStream(final int[] interval) {
+        this.interval = interval;
 
 Review comment:
   `this.interval = Arrays.copyOf(interval, interval.length);` to prevent 
mutability issues? Not sure if there is any risk (i.e. if internal only, 
probably not at risk, but may be still a good idea to play defensively here)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to