src/AnvilPacker/Util/Mem.cs
/// <summary> Returns a reference to the n-th byte of the array. </summary>
/// <remarks> This method only supports one dimensional arrays. </remarks>
Returns a reference to the n-th byte of the array.
Returns a reference to the n - th byte of the array .
[MethodImpl(Inline)]
        public static ref byte GetByteRef(Array array)
        {
            Debug.Assert(array.Rank == 1 && array.GetType().GetElementType()!.IsPrimitive);
            return ref MemoryMarshal.GetArrayDataReference(Unsafe.As<byte[]>(array));
        }
[ MethodImpl ( Inline ) ] public static ref byte GetByteRef ( Array array ) { Debug . Assert ( array . Rank == 1 && array . GetType ( ) . GetElementType ( ) ! . IsPrimitive ) ; return ref MemoryMarshal . GetArrayDataReference ( Unsafe . As < byte [ ] > ( array ) ) ; }
Returns a reference to the n-th byte of the array.
Returns a reference to the n - th byte of the array .
// return &arr.data + byteOffset
array
Array
remarks
This method only supports one dimensional arrays.
This method only supports one dimensional arrays .