static final Mode NUMERIC = new Mode(new int[]{10, 12, 14});
static final Mode ALPHANUMERIC = new Mode(new int[]{9, 11, 13});
static final Mode BYTE = new Mode(new int[]{8, 16, 16});
+ static final Mode ECI = new Mode(null); // character counts don't apply
static final Mode KANJI = new Mode(new int[]{8, 10, 12});
private final int[] characterCountBitsForVersions;
return ALPHANUMERIC;
case 0x4:
return BYTE;
+ case 0x7:
+ return ECI;
case 0x8:
return KANJI;
default:
* 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");
+ }
int number = version.getVersionNumber();
int offset;
if (number <= 9) {