Class DecodedBitStreamParser
- java.lang.Object
-
- com.google.zxing.datamatrix.decoder.DecodedBitStreamParser
-
final class DecodedBitStreamParser extends java.lang.Object
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 Modifier and Type Class Description private static class
DecodedBitStreamParser.Mode
-
Field Summary
Fields Modifier and Type Field Description private static char[]
C40_BASIC_SET_CHARS
See ISO 16022:2006, Annex C Table C.1 The C40 Basic Character Set (*'s used for placeholders for the shift values)private static char[]
C40_SHIFT2_SET_CHARS
private static char[]
TEXT_BASIC_SET_CHARS
See ISO 16022:2006, Annex C Table C.2 The Text Basic Character Set (*'s used for placeholders for the shift values)private static char[]
TEXT_SHIFT2_SET_CHARS
private static char[]
TEXT_SHIFT3_SET_CHARS
-
Constructor Summary
Constructors Modifier Constructor Description private
DecodedBitStreamParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (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, java.lang.StringBuilder resultTrailer, java.util.Set<java.lang.Integer> fnc1positions)
See ISO 16022:2006, 5.2.3 and Annex C, Table C.2private static void
decodeBase256Segment(BitSource bits, ECIStringBuilder result, java.util.Collection<byte[]> byteSegments)
See ISO 16022:2006, 5.2.9 and Annex B, B.2private static void
decodeC40Segment(BitSource bits, ECIStringBuilder result, java.util.Set<java.lang.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, java.util.Set<java.lang.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 Detail
-
C40_BASIC_SET_CHARS
private static final char[] C40_BASIC_SET_CHARS
See 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_CHARS
See 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
-
-
Method Detail
-
decode
static DecoderResult decode(byte[] bytes) throws FormatException
- Throws:
FormatException
-
decodeAsciiSegment
private static DecodedBitStreamParser.Mode decodeAsciiSegment(BitSource bits, ECIStringBuilder result, java.lang.StringBuilder resultTrailer, java.util.Set<java.lang.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, java.util.Set<java.lang.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, java.util.Set<java.lang.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
private static void decodeEdifactSegment(BitSource bits, ECIStringBuilder result)
See ISO 16022:2006, 5.2.8 and Annex C Table C.3
-
decodeBase256Segment
private static void decodeBase256Segment(BitSource bits, ECIStringBuilder result, java.util.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
-
-