Пример #1
0
 public static T Read <[Primitive] T>(this Span <byte> slice)
     where T : struct
 {
     Contract.Requires(slice.Length >= PtrUtils.SizeOf <T>());
     return(PtrUtils.Get <T>(slice.Object, slice.Offset));
 }
Пример #2
0
 public static T Read <[Primitive] T>(this ReadOnlySpan <byte> slice)
     where T : struct
 {
     Contract.RequiresInInclusiveRange(PtrUtils.SizeOf <T>(), (uint)slice.Length);
     return(PtrUtils.Get <T>(slice.Object, slice.Offset, (UIntPtr)0));
 }
Пример #3
0
 internal T GetItemWithoutBoundariesCheck(int index)
 {
     return(PtrUtils.Get <T>(Object, Offset, (UIntPtr)index));
 }
Пример #4
0
 internal T GetItemWithoutBoundariesCheck(int index)
 {
     return(PtrUtils.Get <T>(
                Object, Offset + (index * PtrUtils.SizeOf <T>())));
 }