ArtemisComm.ShipAction3Packet.ShipAction3Packet C# (CSharp) Метод

ShipAction3Packet() публичный Метод

public ShipAction3Packet ( Stream stream, int index ) : ArtemisComm.ShipAction3SubPackets
stream Stream
index int
Результат ArtemisComm.ShipAction3SubPackets
        public ShipAction3Packet(Stream stream, int index) : base()
        {
            try
            {
                if (stream != null)
                {
                    if (stream.CanSeek)
                    {
                        stream.Position = index;
                    }
                    if (index < stream.Length - 3)
                    {
                        SubPacketType = (ShipAction3SubPacketType)stream.ToInt32();
                    }
                    if (index < stream.Length - 4)
                    {
                        SubPacketData = stream.GetMemoryStream(index + 4);
                        _subPacket = GetSubPacket(SubPacketData);
                    }
                    else
                    {
                        _subPacket = null;
                        SubPacketData = null;
                    }
                }
            }
            catch (Exception ex)
            {
                AddError(ex);
            }
        }

Same methods

ShipAction3Packet::ShipAction3Packet ( IPackage subPacket ) : ArtemisComm.ShipAction3SubPackets