code: 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;
                  writer.write((String) closure.call(new String(chars)));
              }
              writer.flush();
  
              Writer temp2 = writer;
              writer = null;
              temp2.close();
              Reader temp1 = self;
              self = null;
              temp1.close();
          } finally {
              closeWithWarning(self);
              closeWithWarning(writer);
          }
      }
docs: 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 be both be
  closed before this method returns.
  
  @param self    a Reader object
  @param writer  a Writer to receive the transformed characters
  @param closure a closure that performs the required transformation
  @throws IOException if an IOException occurs.
  @since 1.5.0