using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace DataCollection.Tools
{
    internal static class BitChange
    {
        public static void Changed(ref byte data,uint bytecountperNum,uint number)
        {
            if (bytecountperNum <= 1 || number == 0) return;
            byte[] temp = new byte[bytecountperNum];
            for (uint i = 0; i < number; i++)
            {
                ref byte start = ref Unsafe.Add(ref data, number * bytecountperNum);
                Unsafe.CopyBlock(ref start, ref temp[0], bytecountperNum);
                Array.Reverse(temp);
                Unsafe.CopyBlock(ref temp[0], ref start, bytecountperNum);
            }
        }
    }
}
