break;\r
}\r
default: {\r
- // Default to text compaction. During testing numberous barcodes\r
+ // Default to text compaction. During testing numerous barcodes\r
// appeared to be missing the starting mode. In these cases defaulting\r
// to text compaction seems to work.\r
codeIndex--;\r
throw ReaderException.getInstance();\r
}\r
}\r
- return new DecoderResult(null, result.toString(), null);\r
+ return new DecoderResult(null, result.toString(), null, null);\r
}\r
\r
/**\r
*/\r
private static int textCompaction(int[] codewords, int codeIndex, StringBuffer result) {\r
// 2 character per codeword\r
- int[] textCompactionData = new int[codewords[0] * 2];\r
+ int[] textCompactionData = new int[codewords[0] << 1];\r
// Used to hold the byte compaction value if there is a mode shift\r
- int[] byteCompactionData = new int[codewords[0] * 2];\r
+ int[] byteCompactionData = new int[codewords[0] << 1];\r
\r
int index = 0;\r
- int code = 0;\r
boolean end = false;\r
while ((codeIndex < codewords[0]) && !end) {\r
- code = codewords[codeIndex++];\r
+ int code = codewords[codeIndex++];\r
if (code < TEXT_COMPACTION_MODE_LATCH) {\r
textCompactionData[index] = code / 30;\r
textCompactionData[index + 1] = code % 30;\r
long value = 0;\r
char[] decodedData = new char[6];\r
int[] byteCompactedCodewords = new int[6];\r
- int code = 0;\r
boolean end = false;\r
while ((codeIndex < codewords[0]) && !end) {\r
- code = codewords[codeIndex++];\r
+ int code = codewords[codeIndex++];\r
if (code < TEXT_COMPACTION_MODE_LATCH) {\r
byteCompactedCodewords[count] = code;\r
count++;\r
// is an integer multiple of 6\r
int count = 0;\r
long value = 0;\r
- int code = 0;\r
boolean end = false;\r
while ((codeIndex < codewords[0]) && !end) {\r
- code = codewords[codeIndex++];\r
+ int code = codewords[codeIndex++];\r
if (code < TEXT_COMPACTION_MODE_LATCH) {\r
count += 1;\r
// Base 900\r
*/\r
private static String decodeBase900toBase10(int[] codewords, int count) {\r
StringBuffer accum = null;\r
- StringBuffer value = null;\r
for (int i = 0; i < count; i++) {\r
- value = multiply(EXP900[count - i - 1], codewords[i]);\r
+ StringBuffer value = multiply(EXP900[count - i - 1], codewords[i]);\r
if (accum == null) {\r
// First time in accum=0\r
accum = value;\r
}\r
}\r
String result = null;\r
- // Remove leading '1' which was inserted to preserce\r
+ // Remove leading '1' which was inserted to preserve\r
// leading zeros\r
for (int i = 0; i < accum.length(); i++) {\r
if (accum.charAt(i) == '1') {\r