mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 13:04:05 -08:00
Correct a few more things about ECI parsing
git-svn-id: https://zxing.googlecode.com/svn/trunk@451 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
466130bcf0
commit
24e31c6a9a
|
@ -115,12 +115,10 @@ final class DecodedBitStreamParser {
|
|||
return ((firstByte & 0x3F) << 8) | secondByte;
|
||||
} else if ((firstByte & 0xE0) == 0xC0) {
|
||||
// three bytes
|
||||
int secondByte = bits.readBits(8);
|
||||
int thirdByte = bits.readBits(8);
|
||||
return ((firstByte & 0x1F) << 16) | (secondByte << 8) | thirdByte;
|
||||
int secondThirdBytes = bits.readBits(16);
|
||||
return ((firstByte & 0x1F) << 16) | secondThirdBytes;
|
||||
}
|
||||
// FIXME: What should we return here?
|
||||
return 0;
|
||||
throw new IllegalArgumentException("Bad ECI bits starting with byte " + firstByte);
|
||||
}
|
||||
|
||||
private static void decodeKanjiSegment(BitSource bits,
|
||||
|
|
|
@ -71,8 +71,8 @@ final class Mode {
|
|||
* count of characters that will follow encoded in this {@link Mode}
|
||||
*/
|
||||
int getCharacterCountBits(Version version) {
|
||||
if (this == ECI) {
|
||||
throw new UnsupportedOperationException("Character count doesn't apply to ECI mode");
|
||||
if (this.equals(ECI)) {
|
||||
throw new IllegalArgumentException("Character count doesn't apply to ECI mode");
|
||||
}
|
||||
int number = version.getVersionNumber();
|
||||
int offset;
|
||||
|
|
Loading…
Reference in a new issue