src/main/java/org/organicelement/deployment/model/utils/StreamUtils.java
public static void copyReaderToWriter(Reader input, Writer output,
            boolean close) throws IOException {
        try {
            BufferedReader in = bufferInput(input);
            BufferedWriter out = bufferOutput(output);
            int ch = in.read();
            while (ch != -1) {
                out.write(ch);
                ch = in.read();
            }
            out.flush();
            out.close();
        } finally {
            if (close) {
                input.close();
                output.close();
            }
        }
    }
/**
     * Copies the Reader to the Writer.
     * @param input The input characters.
     * @param output The destination of the characters.
     * @param close true if the reader and writer should be closed after the
     *        operation is completed.
     * @throws IOException If an underlying I/O problem occured.
     */
Copies the Reader to the Writer.
@param input The input characters.
@param output The destination of the characters.
@param close true if the reader and writer should be closed after the
operation is completed.
@throws IOException If an underlying I/O problem occured.
Copies the Reader to the Writer . @param input The input characters . @param output The destination of the characters . @param close true if the reader and writer should be closed after the operation is completed . @throws IOException If an underlying I / O problem occured .
public static void copyReaderToWriter(Reader input, Writer output,
            boolean close) throws IOException {
        try {
            BufferedReader in = bufferInput(input);
            BufferedWriter out = bufferOutput(output);
            int ch = in.read();
            while (ch != -1) {
                out.write(ch);
                ch = in.read();
            }
            out.flush();
            out.close();
        } finally {
            if (close) {
                input.close();
                output.close();
            }
        }
    }
public static void copyReaderToWriter ( Reader input , Writer output , boolean close ) throws IOException { try { BufferedReader in = bufferInput ( input ) ; BufferedWriter out = bufferOutput ( output ) ; int ch = in . read ( ) ; while ( ch != - 1 ) { out . write ( ch ) ; ch = in . read ( ) ; } out . flush ( ) ; out . close ( ) ; } finally { if ( close ) { input . close ( ) ; output . close ( ) ; } } }
Copies the Reader to the Writer.
Copies the Reader to the Writer .