class IOFactory {

    void writeContent(BufferedWriter writer, File content, ContentConverter contentConverter) throws IOException {
        BufferedReader contentReader = null;
        try {
            contentReader = newReader(content);
            String line;
            while ((line = contentReader.readLine()) != null) {
                writeLine(writer, contentConverter.convert(line));
            }
        } finally {
            if (contentReader != null) {
                contentReader.close();
            }
        }
    }

}