Changed output_file() to read many bytes at a time

Instead of using getc() and putc(), reading one byte at a time (which is very slow), output_file() now reads many bytes at one time into a buffer and writes the buffer to the output file.
Fixed syntax error
Merge pull request #1 from jamestn529/patch-1

Changed output_file() to read many bytes at a time