public static void transformChar(Reader self,Writer writer,@ClosureParams(value=SimpleType.class,options="java.lang.String") Closure closure) throws IOException {
  int c;
  try {
    char[] chars=new char[1];
    while ((c=self.read()) != -1) {
      chars[0]=(char)c;
      Object o=closure.call(new String(chars));
      if (o != null) {
        writer.write(o.toString());
      }
    }
    writer.flush();
    Writer temp2=writer;
    writer=null;
    temp2.close();
    Reader temp1=self;
    self=null;
    temp1.close();
  }
  finally {
    closeWithWarning(self);
    closeWithWarning(writer);
  }
}

public static void transformChar ( Reader self , Writer writer , @ ClosureParams ( value = SimpleType . class , options = "java.lang.String" ) Closure closure ) throws IOException { int c ; try { char [ ] chars = new char [ 1 ] ; while ( ( c = self . read ( ) ) != - 1 ) { chars [ 0 ] = ( char ) c ; Object o = closure . call ( new String ( chars ) ) ; if ( o != null ) { writer . write ( o . toString ( ) ) ; } } writer . flush ( ) ; Writer temp2 = writer ; writer = null ; temp2 . close ( ) ; Reader temp1 = self ; self = null ; temp1 . close ( ) ; } finally { closeWithWarning ( self ) ; closeWithWarning ( writer ) ; } }
transforms each character from this reader by passing it to the given closure . the closure should return each transformed character , which will be passed to the writer . the reader and writer will both be closed before this method returns .
