// 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; class MainClass { public static void Main(string[] args) { byte[] ba = new byte[4]; ba[0] = 1; ba[1] = 2; ba[2] = 3; ba[3] = 4; MemoryStream ms = new MemoryStream(ba); BinaryReader br = new BinaryReader(ms); for(int i = 0; i < ba.Length/2; i++) { short s = br.ReadInt16(); Console.WriteLine(s); } } }