コード例 #1
0
        public static IPacket PacketAnalyzer(Byte[] packetByte)
        {
            Int32   offset     = 0;
            Int64   packetType = PacketUtil.DecodePacketType(packetByte, ref offset);
            IPacket packet     = PacketFactory.GetPacket(packetType);

            if (packet == null)
            {
                return(null);
            }
            if (offset < packetByte.Length)
            {
                packet.Decode(packetByte, ref offset);
            }
            return(packet);
        }