ReedSolomonDecoder (ZXing 3.5.2 API)
Description: declaration: package: com.google.zxing.common.reedsolomon, class: ReedSolomonDecoder

Package com.google.zxing.common.reedsolomon

# Class ReedSolomonDecoder

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

public final class ReedSolomonDecoder extends Object

Implements Reed-Solomon decoding, as the name implies.

The algorithm will not be explained here, but the following references were helpful in creating this implementation:

- Bruce Maggs. "Decoding Reed-Solomon Codes" (see discussion of Forney's Formula)
- J.I. Hall. "Chapter 5. Generalized Reed-Solomon Codes" (see discussion of Euclidean algorithm)

Much credit is due to William Rucklidge since portions of this code are an indirect port of his C++ Reed-Solomon implementation.

Author:
  Sean Owen, William Rucklidge, sanfordsquires

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReedSolomonDecoder(GenericGF field)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `decode(int[] received, int twoS)`
  Decodes given set of received codewords, which include both data and error-correction codewords.
  `int`
  `decodeWithECCount(int[] received, int twoS)`
  Decodes given set of received codewords, which include both data and error-correction codewords.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ReedSolomonDecoder

    public ReedSolomonDecoder(GenericGF field)

- ## Method Details

  - ### decode

    public void decode(int[] received, int twoS) throws ReedSolomonException

    Decodes given set of received codewords, which include both data and error-correction codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, in the input.

    Parameters:
      `received` - data and error-correction codewords
      `twoS` - number of error-correction codewords available
    Throws:
      `ReedSolomonException` - if decoding fails for any reason

  - ### decodeWithECCount

    public int decodeWithECCount(int[] received, int twoS) throws ReedSolomonException

    Decodes given set of received codewords, which include both data and error-correction codewords. Really, this means it uses Reed-Solomon to detect and correct errors, in-place, in the input.

    Parameters:
      `received` - data and error-correction codewords
      `twoS` - number of error-correction codewords available
    Returns:
      the number of errors corrected
    Throws:
      `ReedSolomonException` - if decoding fails for any reason