// 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; namespace E { public class Program { public static void Main(string[] args) { byte[] data = new byte[2]; data[0] = 0xFB; data[1] = 0xFF; short v1 = BitConverter.ToInt16(data, 0); Console.WriteLine(v1); short v2 = (short)((data[1] << 8) | data[0]); Console.WriteLine(v2); } } }