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#?
Java – How to save byte[] to a filewrite is the simplest solution to save byte[] to a file. // bytes = byte[] Path path = Paths. get("/path/file"); Files. write(path, bytes);
Convert byte[] array to File using Java In order to convert a byte array to a file, we will be using a method named the getBytes() method of String class.
That would be File.WriteAllBytes().
System.IO.File.WriteAllBytes(path, data) should do fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With