Code93Writer.java (zxing-zxing-3.4.1) | : | Code93Writer.java (zxing-zxing-3.5.0) | ||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
/** | /** | |||
* @param contents barcode contents to encode. It should not be encoded for ex tended characters. | * @param contents barcode contents to encode. It should not be encoded for ex tended characters. | |||
* @return a {@code boolean[]} of horizontal pixels (false = white, true = bla ck) | * @return a {@code boolean[]} of horizontal pixels (false = white, true = bla ck) | |||
*/ | */ | |||
@Override | @Override | |||
public boolean[] encode(String contents) { | public boolean[] encode(String contents) { | |||
contents = convertToExtended(contents); | contents = convertToExtended(contents); | |||
int length = contents.length(); | int length = contents.length(); | |||
if (length > 80) { | if (length > 80) { | |||
throw new IllegalArgumentException( | throw new IllegalArgumentException("Requested contents should be less than | |||
"Requested contents should be less than 80 digits long after converting | 80 digits long after " + | |||
to extended encoding, but got " + length); | "converting to extended encoding, but got " + length); | |||
} | } | |||
//length of code + 2 start/stop characters + 2 checksums, each of 9 bits, pl us a termination bar | //length of code + 2 start/stop characters + 2 checksums, each of 9 bits, pl us a termination bar | |||
int codeWidth = (contents.length() + 2 + 2) * 9 + 1; | int codeWidth = (contents.length() + 2 + 2) * 9 + 1; | |||
boolean[] result = new boolean[codeWidth]; | boolean[] result = new boolean[codeWidth]; | |||
//start character (*) | //start character (*) | |||
int pos = appendPattern(result, 0, Code93Reader.ASTERISK_ENCODING); | int pos = appendPattern(result, 0, Code93Reader.ASTERISK_ENCODING); | |||
End of changes. 1 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |