给定var a = new byte[] { 15, 4, 7, 81, ..., 4}
。只需要一个快速获得a[0] | a[1] | ... | a[a.Length]
的方法。
Try
var a = new byte[] {15, 4, 7, 81, 4};
var result = a.Aggregate(0, (current, bt) => current | bt);