src/AnvilPacker/Data/BitArrays/PackedBitStorage.cs
/// <summary> Sets the element at the specified index. Value will be truncated to <see cref="BitsPerElement"/> bits.</summary>
Sets the element at the specified index. Value will be truncated to  bits.
Sets the element at the specified index . Value will be truncated to bits .
public void Set(int index, int value)
        {
            Ensure.IndexValid(index, Count);
            int bitPos = index * BitsPerElement;
            int bytePos = bitPos >> 3;
            int shift = bitPos & 7;
            ulong v = ReadLE(Data, bytePos);
            v = (v & ~(mask << shift)) | ((ulong)value & mask) << shift;
            WriteLE(Data, bytePos, v);
        }
public void Set ( int index , int value ) { Ensure . IndexValid ( index , Count ) ; int bitPos = index * BitsPerElement ; int bytePos = bitPos >> 3 ; int shift = bitPos & 7 ; ulong v = ReadLE ( Data , bytePos ) ; v = ( v & ~ ( mask << shift ) ) | ( ( ulong ) value & mask ) << shift ; WriteLE ( Data , bytePos , v ) ; }
Sets the element at the specified index.
Sets the element at the specified index .
index
int
value
int