public static void copy(Reader reader,Writer writer) throws IOException {
  char[] buffer=new char[2048];
  int i;
  while ((i=reader.read(buffer)) > 0) {
    writer.write(buffer,0,i);
  }
}

public static void copy ( Reader reader , Writer writer ) throws IOException { char [ ] buffer = new char [ 2048 ] ; int i ; while ( ( i = reader . read ( buffer ) ) > 0 ) { writer . write ( buffer , 0 , i ) ; } }
copy data from a reader to a writer and do not close i / o .
