// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.IO; using System.Text; class MainClass { public static void Main(string[] args) { byte[] b = { 0x41, 0x0D, 0x0A, 0x42, 0x42, 0x0D, 0x0A, 0x43, 0x43, 0x43, 0x0D, 0x0A }; StreamReader sr = new StreamReader(new MemoryStream(b), Encoding.Default); string line; while((line = sr.ReadLine()) != null) { Console.WriteLine(line); } } }