java.lang.Object
com.google.zxing.qrcode.encoder.BlockPair
Represents a pair of data and error correction blocks for QR code encoding. This class holds the data bytes and their corresponding error correction bytes as generated during the QR code encoding process.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]The block's data codewords.private final byte[]The block's error correction codewords.Constructor Summary
ConstructorsConstructorDescriptionBlockPair(byte[] data, byte[] errorCorrection) Creates a block holding one slice of the message bytes and its error correction bytes.Method Summary
All MethodsModifier and TypeMethodDescriptionbyte[]Returns the message bytes belonging to this block, before interleaving.byte[]Returns the error correction bytes belonging to this block, before interleaving.
Field Details
dataBytes
private final byte[] dataBytesThe block's data codewords.errorCorrectionBytes
private final byte[] errorCorrectionBytesThe block's error correction codewords.
Constructor Details
BlockPair
BlockPair(byte[] data, byte[] errorCorrection) Creates a block holding one slice of the message bytes and its error correction bytes.- Parameters:
data- this block's slice of the message bytes, before interleavingerrorCorrection- Reed-Solomon check codewords computed for this block
Method Details
getDataBytes
public byte[] getDataBytes()Returns the message bytes belonging to this block, before interleaving.- Returns:
- this block's slice of the message bytes
getErrorCorrectionBytes
public byte[] getErrorCorrectionBytes()Returns the error correction bytes belonging to this block, before interleaving.- Returns:
- this block's Reed-Solomon check codewords