question: private static byte [ ] convertToByteArray ( CharSequence charSequence ) { checkNotNull ( charSequence ) ; byte [ ] byteArray = new byte [ charSequence . length ( ) << 1 ] ; for ( int i = 0 ; i < charSequence . length ( ) ; i ++ ) { int bytePosition = i << 1 ; byteArray [ bytePosition ] = ( byte ) ( ( charSequence . charAt ( i ) & 0xFF00 ) > > 8 ) ; byteArray [ bytePosition + 1 ] = ( byte ) ( charSequence . charAt ( i ) & 0x00FF ) ; } return byteArray ; }
target:  Convert a CharSequence (which are UTF16) into a byte array. Note: a String.getBytes() is not used to avoid creating a String of the password in the JVM.