private static int [ ] getErrorCorrection ( int [ ] codewords , int ecclen ) { ReedSolomon rs = new ReedSolomon ( ) ; rs . init_gf ( 0x43 ) ; rs . init_code ( ecclen , 1 ) ; rs . encode ( codewords . length , codewords ) ; int [ ] results = new int [ ecclen ] ; for ( int i = 0 ; i < ecclen ; i ++ ) { results [ i ] = rs . getResult ( results . length - 1 - i ) ; } return results ; }
Returns the error correction codewords for the specified data codewords .