[Solved] How to perform bit copy in C# or byte array left shift operation


I can’t well understand your question, but here I show you how to concatenate bits.

        byte bits2 = 0b_000000_10;
        byte bits6 = 0b_00_101100;
        ushort bits14 = 0b_00_10110010001110;

        uint concatenated = ((uint)bits2 << 20) + ((uint)bits6 << 14) + (uint)bits14;

        uint test = 0b_00_10_101100_10110010001110;
        if (concatenated == test‬)
        {
            Console.WriteLine("Ok");
        }

4

solved How to perform bit copy in C# or byte array left shift operation