AncsNotifier.AncsManager.ByteArrayToNotificationSourceData C# (CSharp) Method

ByteArrayToNotificationSourceData() private method

private ByteArrayToNotificationSourceData ( byte packet ) : NotificationSourceData
packet byte
return NotificationSourceData
        private NotificationSourceData ByteArrayToNotificationSourceData(byte[] packet)
        {
            GCHandle pinnedPacket = GCHandle.Alloc(packet, GCHandleType.Pinned);
            var msg = Marshal.PtrToStructure<NotificationSourceData>(pinnedPacket.AddrOfPinnedObject());
            pinnedPacket.Free();

            return msg;
        }