private static String arrayToString(byte[] bytes) { int length = bytes.length; StringBuilder result = new StringBuilder(length << 2); int i = 0; while (i < length) { int max = Math.min(i + 8, length); for (int j = i; j < max; j++) { int value = bytes[j] & 0xFF; result.append(Integer.toHexString(value / 16)); result.append(Integer.toHexString(value % 16)); result.append(' '); } result.append('\n'); i += 8; } for (int j = i - 8; j < length; j++) { result.append(Integer.toHexString(bytes[j] & 0xFF)); result.append(' '); } return result.toString(); } response.setHeader("Cache-Control", "no-cache"); ]]> Decode Succeeded for (Result result : (List<Result>) request.getAttribute("results")) { ParsedResult parsedResult = ResultParser.parseResult(result); String text = result.getText(); if (text == null) { text = "(Not applicable)"; } else { text = StringEscapeUtils.escapeXml(text); } byte[] rawBytes = result.getRawBytes(); String rawBytesString; if (rawBytes == null) { rawBytesString = "(Not applicable)"; } else { rawBytesString = arrayToString(rawBytes); } String displayResult = parsedResult.getDisplayResult(); if (displayResult == null) { displayResult = "(Not applicable)"; } else { displayResult = StringEscapeUtils.escapeXml(displayResult); }
Raw text text
Raw bytes rawBytesString
Barcode format result.getBarcodeFormat()
Parsed Result Type parsedResult.getType()
Parsed Result displayResult

}