Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #3
0
 internal T GetItemWithoutBoundariesCheck(int index)
 {
     return(PtrUtils.Get <T>(Object, Offset, (UIntPtr)index));
 }
Beispiel #4
0
 internal T GetItemWithoutBoundariesCheck(int index)
 {
     return(PtrUtils.Get <T>(
                Object, Offset + (index * PtrUtils.SizeOf <T>())));
 }