\r
package com.google.zxing.datamatrix.decoder;\r
\r
-import com.google.zxing.ReaderException;\r
+import com.google.zxing.FormatException;\r
import com.google.zxing.common.BitMatrix;\r
\r
/**\r
\r
/**\r
* @param bitMatrix {@link BitMatrix} to parse\r
- * @throws ReaderException if dimension is < 10 or > 144 or not 0 mod 2\r
+ * @throws FormatException if dimension is < 10 or > 144 or not 0 mod 2\r
*/\r
- BitMatrixParser(BitMatrix bitMatrix) throws ReaderException {\r
+ BitMatrixParser(BitMatrix bitMatrix) throws FormatException {\r
int dimension = bitMatrix.getDimension();\r
if (dimension < 10 || dimension > 144 || (dimension & 0x01) != 0) {\r
- throw ReaderException.getInstance();\r
+ throw FormatException.getFormatInstance();\r
}\r
\r
version = readVersion(bitMatrix);\r
* \r
* @param bitMatrix Original {@link BitMatrix} including alignment patterns\r
* @return {@link Version} encapsulating the Data Matrix Code's "version"\r
- * @throws ReaderException if the dimensions of the mapping matrix are not valid\r
+ * @throws FormatException if the dimensions of the mapping matrix are not valid\r
* Data Matrix dimensions.\r
*/\r
- Version readVersion(BitMatrix bitMatrix) throws ReaderException {\r
+ Version readVersion(BitMatrix bitMatrix) throws FormatException {\r
\r
if (version != null) {\r
return version;\r
* Data Matrix Code.</p>\r
*\r
* @return bytes encoded within the Data Matrix Code\r
- * @throws ReaderException if the exact number of bytes expected is not read\r
+ * @throws FormatException if the exact number of bytes expected is not read\r
*/\r
- byte[] readCodewords() throws ReaderException {\r
+ byte[] readCodewords() throws FormatException {\r
\r
byte[] result = new byte[version.getTotalCodewords()];\r
int resultOffset = 0;\r
} while ((row < numRows) || (column < numColumns));\r
\r
if (resultOffset != version.getTotalCodewords()) {\r
- throw ReaderException.getInstance();\r
+ throw FormatException.getFormatInstance();\r
}\r
return result;\r
}\r