public void write(ByteAppendable os, char ch)
    throws IOException
  {
    if (ch < 0x80)
      os.write(ch);
    else {
      os.write('\\');
      os.write('u');

      int b = (ch >> 12) & 0xf;
      os.write(b < 10 ? b + '0' : b + 'a' - 10);
      b = (ch >> 8) & 0xf;
      os.write(b < 10 ? b + '0' : b + 'a' - 10);
      b = (ch >> 4) & 0xf;
      os.write(b < 10 ? b + '0' : b + 'a' - 10);
      b = ch & 0xf;
      os.write(b < 10 ? b + '0' : b + 'a' - 10);
    }
  }
public void write ( ByteAppendable os , char ch ) throws IOException { if ( ch < 0x80 ) os . write ( ch ) ; else { os . write ( '\\' ) ; os . write ( 'u' ) ; int b = ( ch > > 12 ) & 0xf ; os . write ( b < 10 ? b + '0' : b + 'a' - 10 ) ; b = ( ch > > 8 ) & 0xf ; os . write ( b < 10 ? b + '0' : b + 'a' - 10 ) ; b = ( ch > > 4 ) & 0xf ; os . write ( b < 10 ? b + '0' : b + 'a' - 10 ) ; b = ch & 0xf ; os . write ( b < 10 ? b + '0' : b + 'a' - 10 ) ; } }
Writes a character to the output stream with the correct encoding.

@param ch the character to write.