Save byte array to file in C#
To save bytes array to file in C# we can directly useFile.WriteAllBytes()
which is part of System.IO
namespace.using System;
using System.IO;
public class Example
{
public static void Main()
{
var arrBytes = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 };
File.WriteAllBytes("Foo.txt", arrBytes);
}
}