new file writer method, using a stream