Package com.google.zxing.qrcode.decoder
Class DataBlock
java.lang.Object
com.google.zxing.qrcode.decoder.DataBlock
Encapsulates a block of data within a QR Code. QR Codes may split their data into multiple blocks, each of which is a unit of data and error-correction codewords. Each is represented by an instance of this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) byte[]
(package private) static DataBlock[]
getDataBlocks
(byte[] rawCodewords, Version version, ErrorCorrectionLevel ecLevel) When QR Codes use multiple data blocks, they are actually interleaved.(package private) int
-
Field Details
-
numDataCodewords
private final int numDataCodewords -
codewords
private final byte[] codewords
-
-
Constructor Details
-
DataBlock
private DataBlock(int numDataCodewords, byte[] codewords)
-
-
Method Details
-
getDataBlocks
static DataBlock[] getDataBlocks(byte[] rawCodewords, Version version, ErrorCorrectionLevel ecLevel) When QR Codes use multiple data blocks, they are actually interleaved. That is, the first byte of data block 1 to n is written, then the second bytes, and so on. This method will separate the data into original blocks.
- Parameters:
rawCodewords
- bytes as read directly from the QR Codeversion
- version of the QR CodeecLevel
- error-correction level of the QR Code- Returns:
- DataBlocks containing original bytes, "de-interleaved" from representation in the QR Code
-
getNumDataCodewords
int getNumDataCodewords() -
getCodewords
byte[] getCodewords()
-