Class DecodedBitStreamParser
java.lang.Object
com.google.zxing.datamatrix.decoder.DecodedBitStreamParser
Data Matrix Codes can encode text as bits in one of several modes, and can use multiple modes in one Data Matrix Code. This class decodes the bits back into text.
See ISO 16022:2006, 5.2.1 - 5.2.9.2
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final char[]
See ISO 16022:2006, Annex C Table C.1 The C40 Basic Character Set (*'s used for placeholders for the shift values)private static final char[]
private static final char[]
See ISO 16022:2006, Annex C Table C.2 The Text Basic Character Set (*'s used for placeholders for the shift values)private static final char[]
private static final char[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static DecoderResult
decode
(byte[] bytes) private static void
decodeAnsiX12Segment
(BitSource bits, ECIStringBuilder result) See ISO 16022:2006, 5.2.7private static DecodedBitStreamParser.Mode
decodeAsciiSegment
(BitSource bits, ECIStringBuilder result, StringBuilder resultTrailer, Set<Integer> fnc1positions) See ISO 16022:2006, 5.2.3 and Annex C, Table C.2private static void
decodeBase256Segment
(BitSource bits, ECIStringBuilder result, Collection<byte[]> byteSegments) See ISO 16022:2006, 5.2.9 and Annex B, B.2private static void
decodeC40Segment
(BitSource bits, ECIStringBuilder result, Set<Integer> fnc1positions) See ISO 16022:2006, 5.2.5 and Annex C, Table C.1private static void
decodeECISegment
(BitSource bits, ECIStringBuilder result) See ISO 16022:2007, 5.4.1private static void
decodeEdifactSegment
(BitSource bits, ECIStringBuilder result) See ISO 16022:2006, 5.2.8 and Annex C Table C.3private static void
decodeTextSegment
(BitSource bits, ECIStringBuilder result, Set<Integer> fnc1positions) See ISO 16022:2006, 5.2.6 and Annex C, Table C.2private static void
parseTwoBytes
(int firstByte, int secondByte, int[] result) private static int
unrandomize255State
(int randomizedBase256Codeword, int base256CodewordPosition) See ISO 16022:2006, Annex B, B.2
-
Field Details
-
C40_BASIC_SET_CHARS
private static final char[] C40_BASIC_SET_CHARSSee ISO 16022:2006, Annex C Table C.1 The C40 Basic Character Set (*'s used for placeholders for the shift values) -
C40_SHIFT2_SET_CHARS
private static final char[] C40_SHIFT2_SET_CHARS -
TEXT_BASIC_SET_CHARS
private static final char[] TEXT_BASIC_SET_CHARSSee ISO 16022:2006, Annex C Table C.2 The Text Basic Character Set (*'s used for placeholders for the shift values) -
TEXT_SHIFT2_SET_CHARS
private static final char[] TEXT_SHIFT2_SET_CHARS -
TEXT_SHIFT3_SET_CHARS
private static final char[] TEXT_SHIFT3_SET_CHARS
-
-
Constructor Details
-
DecodedBitStreamParser
private DecodedBitStreamParser()
-
-
Method Details
-
decode
- Throws:
FormatException
-
decodeAsciiSegment
private static DecodedBitStreamParser.Mode decodeAsciiSegment(BitSource bits, ECIStringBuilder result, StringBuilder resultTrailer, Set<Integer> fnc1positions) throws FormatException See ISO 16022:2006, 5.2.3 and Annex C, Table C.2- Throws:
FormatException
-
decodeC40Segment
private static void decodeC40Segment(BitSource bits, ECIStringBuilder result, Set<Integer> fnc1positions) throws FormatException See ISO 16022:2006, 5.2.5 and Annex C, Table C.1- Throws:
FormatException
-
decodeTextSegment
private static void decodeTextSegment(BitSource bits, ECIStringBuilder result, Set<Integer> fnc1positions) throws FormatException See ISO 16022:2006, 5.2.6 and Annex C, Table C.2- Throws:
FormatException
-
decodeAnsiX12Segment
private static void decodeAnsiX12Segment(BitSource bits, ECIStringBuilder result) throws FormatException See ISO 16022:2006, 5.2.7- Throws:
FormatException
-
parseTwoBytes
private static void parseTwoBytes(int firstByte, int secondByte, int[] result) -
decodeEdifactSegment
See ISO 16022:2006, 5.2.8 and Annex C Table C.3 -
decodeBase256Segment
private static void decodeBase256Segment(BitSource bits, ECIStringBuilder result, Collection<byte[]> byteSegments) throws FormatException See ISO 16022:2006, 5.2.9 and Annex B, B.2- Throws:
FormatException
-
decodeECISegment
private static void decodeECISegment(BitSource bits, ECIStringBuilder result) throws FormatException See ISO 16022:2007, 5.4.1- Throws:
FormatException
-
unrandomize255State
private static int unrandomize255State(int randomizedBase256Codeword, int base256CodewordPosition) See ISO 16022:2006, Annex B, B.2
-