Save byte array to file
C#FileStreamSaveByteC# Problem Overview
I have a byte array (an IEnumerable
How do I do that?
I found some answers telling how to create a MemoryStream from that, but still can't save it to a brand new file.
C# Solutions
Solution 1 - C#
You can use:
File.WriteAllBytes("Foo.txt", arrBytes); // Requires System.IO
If you have an enumerable and not an array, you can use:
File.WriteAllBytes("Foo.txt", arrBytes.ToArray()); // Requires System.Linq
Solution 2 - C#
You can use File.WriteAllBytes