java.lang.Object
com.google.zxing.common.reedsolomon.ReedSolomonEncoder

public final class ReedSolomonEncoderextends Object

Implements Reed-Solomon encoding, as the name implies.

  • Field Details

    • field

      private final GenericGF field
      The Galois field the codewords live in.
    • cachedGenerators

      private final List<GenericGFPoly> cachedGenerators
      Generators already built, by degree.
  • Constructor Details

    • ReedSolomonEncoder

      public ReedSolomonEncoder(GenericGF field)
      Creates an encoder that computes parity symbols over the given Galois field.
      Parameters:
      field - the Galois field over which the parity symbols are computed
  • Method Details

    • buildGenerator

      private GenericGFPoly buildGenerator(int degree)
      Builds or reuses the generator polynomial of a degree.
      Parameters:
      degree - the number of check symbols
      Returns:
      the generator polynomial
    • encode

      public void encode(int[] toEncode, int ecBytes)
      Appends error correction parity bytes to the end of the message block.
      Parameters:
      toEncode - the message block to encode, with room for the appended parity bytes
      ecBytes - the number of error correction bytes to append, greater than zero