final class DataBlock
extends java.lang.Object
Encapsulates a block of data within a Data Matrix Code. Data Matrix 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.
Modifier and Type | Field and Description |
---|---|
private byte[] |
codewords |
private int |
numDataCodewords |
Modifier | Constructor and Description |
---|---|
private |
DataBlock(int numDataCodewords,
byte[] codewords) |
Modifier and Type | Method and Description |
---|---|
(package private) byte[] |
getCodewords() |
(package private) static DataBlock[] |
getDataBlocks(byte[] rawCodewords,
Version version)
When Data Matrix Codes use multiple data blocks, they actually interleave the bytes of each of them.
|
(package private) int |
getNumDataCodewords() |
private final int numDataCodewords
private final byte[] codewords
static DataBlock[] getDataBlocks(byte[] rawCodewords, Version version)
When Data Matrix Codes use multiple data blocks, they actually interleave the bytes of each of them. 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.
rawCodewords
- bytes as read directly from the Data Matrix Codeversion
- version of the Data Matrix Codeint getNumDataCodewords()
byte[] getCodewords()