BryanWilhite / SonghayCore

core reusable, opinionated concerns for *all* 🧐 of my C# projects
http://songhayblog.azurewebsites.net/
MIT License
1 stars 0 forks source link

move `ProgramArgsExtensions.WriteOutputToFile` to core #132

Closed BryanWilhite closed 2 years ago

BryanWilhite commented 2 years ago

move this over from Songhay.Player:

//see https://stackoverflow.com/a/5515894/22944
public static void WriteOutputToFile(this ProgramArgs args, Stream stream)
{//TODO: move to Core
    var outputFile = args.GetOutputPath();

    using (var fileStream = File.Create(outputFile))
    {
        stream.Seek(0, SeekOrigin.Begin);
        stream.CopyTo(fileStream);
    }
}