public void setUcode ( String ucode ) { if ( ucode == null ) { throw new IllegalArgumentException ( "'ucode' is null." ) ; } if ( UCODE_PATTERN . matcher ( ucode ) . matches ( ) == false ) { throw new IllegalArgumentException ( "The format of 'ucode' is wrong: " + ucode ) ; } mUcode = ucode ; byte [ ] data = getData ( ) ; for ( int i = 0 ; i < 32 ; i += 2 ) { // Parse the two hex letters. byte value = readHex ( ucode , i ) ; // Store the value in the little endian order. int offset = UCODE_INDEX + ( 15 - i / 2 ) ; data [ offset ] = value ; } }
Set the ucode .