C# program to write byte buffer into a file

Program

using System;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main()
        {
            byte[] byteBuff = { 1,2,3,4,5 };

            File.WriteAllBytes("Sample.txt", byteBuff);

            Console.WriteLine("Data Written Successfully");
        }
    }
}

Output

Data written successfully

Leave a Comment

error: Alert: Content is protected!!