C# Program to Write Byte Buffer Into a File

You are currently viewing C# Program to Write Byte Buffer Into a File

C# program to write byte buffer into a file

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

Ranjith Kumar

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply