private static final < T extends Appendable > void appendEncodedByte ( T buffer , byte value , byte [ ] state ) { try { if ( state [ 0 ] != 0 ) { char c = ( char ) ( ( state [ 1 ] << 8 ) | ( ( value ) & 0xFF ) ) ; buffer . append ( c ) ; state [ 0 ] = 0 ; } else { state [ 0 ] = 1 ; state [ 1 ] = value ; } } catch ( IOException e ) { throw new IllegalIcuArgumentException ( e ) ; } }
Append a byte to the given Appendable packing two bytes into each character . The state parameter maintains intermediary data between calls .