static void EndianSwap (ref byte[] value) { byte[] buf = new byte[value.Length]; for (int i = 0; i < value.Length; i++) buf[i] = value[value.Length-1-i]; value = buf; }