int decodeVersion ( ) { int bitField = this . bits . read ( 0 , 18 , false ) ; int message ; // see if there's any errors if ( QrCodePolynomialMath . checkVersionBits ( bitField ) ) { message = bitField >> 12 ; } else { message = QrCodePolynomialMath . correctVersionBits ( bitField ) ; } // sanity check results if ( message > QrCode . MAX_VERSION || message < QrCode . VERSION_ENCODED_AT ) return - 1 ; return message ; }
Decode version information from read in bits