Exemplo n.º 1
0
 public static void WriteLittleEndian <[Primitive] T>(this Span <byte> span, T value) where T : struct
 => span.Write(BitConverter.IsLittleEndian ? value : UnsafeUtilities.Reverse(value));
Exemplo n.º 2
0
 public static T ReadLittleEndian <[Primitive] T>(this Span <byte> span) where T : struct
 => BitConverter.IsLittleEndian ? span.Read <T>() : UnsafeUtilities.Reverse(span.Read <T>());