public final String translate(final CharSequence input){
  if (input == null) {
    return null;
  }
  try {
    final StringWriter writer=new StringWriter(input.length() * 2);
    translate(input,writer);
    return writer.toString();
  }
 catch (  final IOException ioe) {
    throw new RuntimeException(ioe);
  }
}

public final String translate ( final CharSequence input ) { if ( input == null ) { return null ; } try { final StringWriter writer = new StringWriter ( input . length ( ) * 2 ) ; translate ( input , writer ) ; return writer . toString ( ) ; } catch ( final IOException ioe ) { throw new RuntimeException ( ioe ) ; } }
helper for non - writer usage .
