Reads and displays bytes until end-of-file : Text File Read Write : File Stream C# Source Code


Custom Search

C# Source Code » File Stream » Text File Read Write »

 

Reads and displays bytes until end-of-file









    


using System;
using System.IO;

public class ReadBytes {
  public static void Main(string[] args) {
      Stream input = new FileStream("test.cs", FileMode.Open);
      int i;
      while((i = input.ReadByte()) != -1)
        Console.Write(i + " ");
      input.Close();
  }
}  
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo File Stream
» Text File Read Write