Use BufferedOutput

Fix to use BufferedOutput class