There are lots of questions around, but mostly are about writing strings to a file. I'm a bit confused!

**What is the proper way to write a stream to a file?**

what I did:

```
Stream stream = await GetStream(source);

var file = await ApplicationData.Current.TemporaryFolder.CreateFileAsync("TempUsersFile", CreationCollisionOption.ReplaceExisting);
var fileStream = await file.OpenAsync(FileAccessMode.ReadWrite);

using (var dataWriter = new Windows.Storage.Streams.DataWriter(fileStream))
{
    // How can I write to buffer and write to the file
}

```