java.lang.Object
com.google.zxing.common.reedsolomon.ReedSolomonEncoder
Implements Reed-Solomon encoding, as the name implies.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<GenericGFPoly> Generators already built, by degree.private final GenericGFThe Galois field the codewords live in.Constructor Summary
ConstructorsConstructorDescriptionReedSolomonEncoder(GenericGF field) Creates an encoder that computes parity symbols over the given Galois field.Method Summary
Modifier and TypeMethodDescriptionprivate GenericGFPolybuildGenerator(int degree) Builds or reuses the generator polynomial of a degree.voidencode(int[] toEncode, int ecBytes) Appends error correction parity bytes to the end of the message block.
Field Details
field
The Galois field the codewords live in.cachedGenerators
Generators already built, by degree.
Constructor Details
ReedSolomonEncoder
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
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 bytesecBytes- the number of error correction bytes to append, greater than zero