X-Git-Url: http://git.rot13.org/?p=zxing.git;a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fqrcode%2Fdecoder%2FBitMatrixParser.java;h=c6f79b3dde5c583d0f7a9a61d89b5132e385be72;hp=fd8071c314c5e4075328047aacdc1035925a4a6a;hb=ac343e4ddc7af1f54c2d2634abb1be992d183a35;hpb=112aa0eb1c6b40b46c58f9133443fa1aa20e49fb diff --git a/core/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java b/core/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java index fd8071c3..c6f79b3d 100644 --- a/core/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java +++ b/core/src/com/google/zxing/qrcode/decoder/BitMatrixParser.java @@ -16,7 +16,7 @@ package com.google.zxing.qrcode.decoder; -import com.google.zxing.ReaderException; +import com.google.zxing.FormatException; import com.google.zxing.common.BitMatrix; /** @@ -30,12 +30,12 @@ final class BitMatrixParser { /** * @param bitMatrix {@link BitMatrix} to parse - * @throws ReaderException if dimension is not >= 21 and 1 mod 4 + * @throws FormatException if dimension is not >= 21 and 1 mod 4 */ - BitMatrixParser(BitMatrix bitMatrix) throws ReaderException { + BitMatrixParser(BitMatrix bitMatrix) throws FormatException { int dimension = bitMatrix.getDimension(); if (dimension < 21 || (dimension & 0x03) != 1) { - throw ReaderException.getInstance(); + throw FormatException.getFormatInstance(); } this.bitMatrix = bitMatrix; } @@ -44,10 +44,10 @@ final class BitMatrixParser { *

Reads format information from one of its two locations within the QR Code.

* * @return {@link FormatInformation} encapsulating the QR Code's format info - * @throws ReaderException if both format information locations cannot be parsed as + * @throws FormatException if both format information locations cannot be parsed as * the valid encoding of format information */ - FormatInformation readFormatInformation() throws ReaderException { + FormatInformation readFormatInformation() throws FormatException { if (parsedFormatInfo != null) { return parsedFormatInfo; @@ -87,17 +87,17 @@ final class BitMatrixParser { if (parsedFormatInfo != null) { return parsedFormatInfo; } - throw ReaderException.getInstance(); + throw FormatException.getFormatInstance(); } /** *

Reads version information from one of its two locations within the QR Code.

* * @return {@link Version} encapsulating the QR Code's version - * @throws ReaderException if both version information locations cannot be parsed as + * @throws FormatException if both version information locations cannot be parsed as * the valid encoding of version information */ - Version readVersion() throws ReaderException { + Version readVersion() throws FormatException { if (parsedVersion != null) { return parsedVersion; @@ -136,7 +136,7 @@ final class BitMatrixParser { if (parsedVersion != null && parsedVersion.getDimensionForVersion() == dimension) { return parsedVersion; } - throw ReaderException.getInstance(); + throw FormatException.getFormatInstance(); } private int copyBit(int i, int j, int versionBits) { @@ -149,9 +149,9 @@ final class BitMatrixParser { * QR Code.

* * @return bytes encoded within the QR Code - * @throws ReaderException if the exact number of bytes expected is not read + * @throws FormatException if the exact number of bytes expected is not read */ - byte[] readCodewords() throws ReaderException { + byte[] readCodewords() throws FormatException { FormatInformation formatInfo = readFormatInformation(); Version version = readVersion(); @@ -200,7 +200,7 @@ final class BitMatrixParser { readingUp ^= true; // readingUp = !readingUp; // switch directions } if (resultOffset != version.getTotalCodewords()) { - throw ReaderException.getInstance(); + throw FormatException.getFormatInstance(); } return result; }