protected static final void outputTextToWriter(final String text,final OutputStream writer) throws IOException {
  final int length=text.length();
  byte[] toWrite;
  for (int i=0; i < length; i++) {
    char c=text.charAt(i);
switch (c) {
case '&':
      toWrite=AMP.clone();
    break;
case '<':
  toWrite=LT.clone();
break;
case '>':
toWrite=GT.clone();
break;
case 0xD:
toWrite=XD.clone();
break;
default :
if (c < 0x80) {
writer.write(c);
}
 else {
UtfHelpper.writeCharToUtf8(c,writer);
}
continue;
}
writer.write(toWrite);
}
}

protected static final void outputTextToWriter ( final String text , final OutputStream writer ) throws IOException { final int length = text . length ( ) ; byte [ ] toWrite ; for ( int i = 0 ; i < length ; i ++ ) { char c = text . charAt ( i ) ; switch ( c ) { case '&' : toWrite = AMP . clone ( ) ; break ; case '<' : toWrite = LT . clone ( ) ; break ; case '>' : toWrite = GT . clone ( ) ; break ; case 0xD : toWrite = XD . clone ( ) ; break ; default : if ( c < 0x80 ) { writer . write ( c ) ; } else { UtfHelpper . writeCharToUtf8 ( c , writer ) ; } continue ; } writer . write ( toWrite ) ; } }
outputs a text of cdata section to the internal writer .
