public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteInt((int)this._pdus.Count);

                    for (int idx = 0; idx < this._pdus.Count; idx++)
                    {
                        Pdu aPdu = (Pdu)this._pdus[idx];
                        aPdu.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfPdus = dis.ReadInt();
                    for (int idx = 0; idx < this.NumberOfPdus; idx++)
                    {
                        Pdu anX = new Pdu();
                        anX.Unmarshal(dis);
                        this._pdus.Add(anX);
                    };

                }
                catch (Exception e)
                {
            #if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
            #endif
                    this.OnException(e);
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        /// 	<c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(Pdu obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return false;
            }

            if (this._protocolVersion != obj._protocolVersion)
            {
                ivarsEqual = false;
            }

            if (this._exerciseID != obj._exerciseID)
            {
                ivarsEqual = false;
            }

            if (this._pduType != obj._pduType)
            {
                ivarsEqual = false;
            }

            if (this._protocolFamily != obj._protocolFamily)
            {
                ivarsEqual = false;
            }

            if (this._timestamp != obj._timestamp)
            {
                ivarsEqual = false;
            }

            if (this._length != obj._length)
            {
                ivarsEqual = false;
            }

            if (this._padding != obj._padding)
            {
                ivarsEqual = false;
            }

            return ivarsEqual;
        }