replaced the bytes.Buffer sample buffer with a bufio.Writer so large files aren't hold in ram