question: public static byte [ ] toUTF8 ( String s ) { byte [ ] result = new byte [ utfLength ( s ) ] ; int result_index = 0 ; for ( int i = 0 , n = s . length ( ) ; i < n ; ++ i ) { char c = s . charAt ( i ) ; if ( ( ( ! WRITE_PSEUDO_UTF8 ) || ( c >= 0x0001 ) ) && ( c <= 0x007F ) ) { result [ result_index ++ ] = ( byte ) c ; } else if ( c > 0x07FF ) { result [ result_index ++ ] = ( byte ) ( 0xe0 | ( byte ) ( c > > 12 ) ) ; result [ result_index ++ ] = ( byte ) ( 0x80 | ( ( c & 0xfc0 ) > > 6 ) ) ; result [ result_index ++ ] = ( byte ) ( 0x80 | ( c & 0x3f ) ) ; } else { result [ result_index ++ ] = ( byte ) ( 0xc0 | ( byte ) ( c > > 6 ) ) ; result [ result_index ++ ] = ( byte ) ( 0x80 | ( c & 0x3f ) ) ; } } return result ; }
target:  Convert the given String into a sequence of (pseudo-)utf8 formatted bytes.<p> The output format is controlled by the WRITE_PSEUDO_UTF8 flag.