Code example for BufferedInputStream

0
        } 
    } 
 
    private static void readFile(File file, Reader reader) throws IOException {
        final FileInputStream fis = new FileInputStream(file);
        final BufferedInputStream bis = new BufferedInputStream(fis);
        try { 
            reader.read(bis);
        } finally { 
            IoUtils.closeQuietly(bis);
        } 
    } 
 
    private static void writeFile(File file, Writer writer) throws IOException {
        final FileOutputStream fos = new FileOutputStream(file);
        final BufferedOutputStream bos = new BufferedOutputStream(fos);
        try { 
            writer.write(bos);
            bos.flush();
        } finally { 
            FileUtils.sync(fos);