using System.Diagnostics.CodeAnalysis; namespace ServicePoint; public sealed partial class Packet { public static bool TryFromBytes(Span bytes, [MaybeNullWhen(false)] out Packet packet) { unsafe { fixed (byte* bytesPtr = bytes) { packet = TryLoad(bytesPtr, (nuint)bytes.Length); return packet != null; } } } }