Given byte buffer and we have to write all bytes in a file using C# program.
File.WriteAllBytes()
This is a method of "File class, it writes all bytes (byte buffer) in a file.
Syntax:
void WriteAllBytes(string filename);
Parameter(s):
- filename - name of the file.
-
Program
Output
Note: In above program, we need to remember, when we use "File" class, System.IO namespace must be included in the program.
need an explanation for this answer? contact us directly to get an explanation for this answer