Issue 512
[zxing.git] / core / src / com / google / zxing / oned / MultiFormatUPCEANReader.java
index f33c9cd..4524f3e 100644 (file)
@@ -18,6 +18,8 @@ package com.google.zxing.oned;
 
 import com.google.zxing.BarcodeFormat;
 import com.google.zxing.DecodeHintType;
+import com.google.zxing.NotFoundException;
+import com.google.zxing.Reader;
 import com.google.zxing.ReaderException;
 import com.google.zxing.Result;
 import com.google.zxing.common.BitArray;
@@ -61,7 +63,7 @@ public final class MultiFormatUPCEANReader extends OneDReader {
     }
   }
 
-  public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException {
+  public Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws NotFoundException {
     // Compute this location once and reuse it on multiple implementations
     int[] startGuardPattern = UPCEANReader.findStartGuardPattern(row);
     int size = readers.size();
@@ -91,7 +93,15 @@ public final class MultiFormatUPCEANReader extends OneDReader {
       return result;
     }
 
-    throw ReaderException.getInstance();
+    throw NotFoundException.getNotFoundInstance();
+  }
+
+  public void reset() {
+    int size = readers.size();
+    for (int i = 0; i < size; i++) {
+      Reader reader = (Reader) readers.elementAt(i);
+      reader.reset();
+    }
   }
 
 }