java.lang.Object
com.google.zxing.qrcode.encoder.BlockPair

final class BlockPairextends Object
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

    Fields
    Modifier and Type
    Field
    Description
    private final byte[]
    The block's data codewords.
    private final byte[]
    The block's error correction codewords.
  • Constructor Summary

    Constructors
    Constructor
    Description
    BlockPair(byte[] data, byte[] errorCorrection)
    Creates a block holding one slice of the message bytes and its error correction bytes.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    byte[]
    Returns the message bytes belonging to this block, before interleaving.
    byte[]
    Returns the error correction bytes belonging to this block, before interleaving.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • dataBytes

      private final byte[] dataBytes
      The block's data codewords.
    • errorCorrectionBytes

      private final byte[] errorCorrectionBytes
      The 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 interleaving
      errorCorrection - 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