public static int copy(Reader input,Writer output) throws IOException {
  char[] buffer=new char[DEFAULT_BUFFER_SIZE];
  int count=0;
  int n=0;
  while (-1 != (n=input.read(buffer))) {
    output.write(buffer,0,n);
    count+=n;
  }
  return count;
}

public static int copy ( Reader input , Writer output ) throws IOException { char [ ] buffer = new char [ DEFAULT_BUFFER_SIZE ] ; int count = 0 ; int n = 0 ; while ( - 1 != ( n = input . read ( buffer ) ) ) { output . write ( buffer , 0 , n ) ; count += n ; } return count ; }
copy input to output ; neither stream is closed
