What is the most efficient way to save a byte array as a file on disk in C#?


Question

Pretty simple scenario. I have a web service that receives a byte array that is to be saved as a particular file type on disk. What is the most efficient way to do this in C#?

1
63
9/24/2008 5:51:47 PM

Accepted Answer

That would be File.WriteAllBytes().

113
9/28/2011 12:15:37 AM

System.IO.File.WriteAllBytes(path, data) should do fine.


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon