public static int ToInt32(ReadOnlySpan <byte> bytes)
 {
     return(IPAddress.NetworkToHostOrder(UnsafeBitConverter.ToInt32(bytes)));
 }
Ejemplo n.º 2
0
 private static bool HasMagicCookie(ReadOnlyMemory <byte> bytes)
 {
     return(UnsafeBitConverter.ToInt32(bytes.Span.Slice(4, 4)) == StunMagicCookie);
 }