Read file stream as an array of bytes : FileStream : File Directory Stream C# Examples


C# Examples » File Directory Stream » FileStream »

 

Read file stream as an array of bytes









    
using  System;
using  System.IO;

public  class  MainClass
{
    static  void  Main(string[]  args)
    {
        FileStream  MyFileStream1  =  new  FileStream(@"c:\Testing.txt",  FileMode.Create);

        int  NumberOfBytes  =  200;
        byte[]  MyByteArray  =  new  Byte[NumberOfBytes];
        int  BytesRead  =  MyFileStream1.Read(MyByteArray,  0,  NumberOfBytes);
        
        MyFileStream1.Close();        
    }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo File Directory Stream
» FileStream