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