Read input from reader and write it to writer until there is no more input from reader. @param reader the reader to read from. @param writer the writer to write to. @param buf the char array to use as a buffer @throws IOException IO error
(Reader reader, Writer writer, char[] buf)
| 46 | * @throws IOException IO error |
| 47 | */ |
| 48 | public static void flow(Reader reader, Writer writer, char[] buf) throws IOException { |
| 49 | int numRead; |
| 50 | while ((numRead = reader.read(buf)) >= 0) { |
| 51 | writer.write(buf, 0, numRead); |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Read input from reader and write it to writer until there is no more input from reader. |