question: static public void writeAttribute ( Writer out , char [ ] buff , char [ ] text , int start , int length ) throws IOException { int buffLength = buff . length ; int buffIndex = 0 ; int end = start + length ; for ( int i = start ; i < end ; i ++ ) { char ch = text [ i ] ; if ( ch < 0xA0 ) { if ( ch >= 0x3f ) { buffIndex = addToBuffer ( out , buff , buffIndex , buffLength , ch ) ; } else if ( ch >= 0x27 ) { if ( ch < 0x3c ) { buffIndex = addToBuffer ( out , buff , buffIndex , buffLength , ch ) ; } else if ( ch == '>' ) { buffIndex = flushBuffer ( out , buff , buffIndex ) ; out . write ( "&gt;" ) ; } else { buffIndex = addToBuffer ( out , buff , buffIndex , buffLength , ch ) ; } } else { if ( ch == '&' ) { buffIndex = flushBuffer ( out , buff , buffIndex ) ; if ( ( i + 1 < end ) && ( text [ i + 1 ] == '{' ) ) { out . write ( ch ) ; } else { out . write ( "&amp;" ) ; } } else if ( ch == '"' ) { buffIndex = flushBuffer ( out , buff , buffIndex ) ; out . write ( "&quot;" ) ; } else { buffIndex = addToBuffer ( out , buff , buffIndex , buffLength , ch ) ; } } } else { buffIndex = flushBuffer ( out , buff , buffIndex ) ; _writeDecRef ( out , ch ) ; } } flushBuffer ( out , buff , buffIndex ) ; }
target:  Write a character array attribute.  Note that this code is duplicated above for string - change both places if you make any changes!!!