Inheritance: SerializableBase
        /// <summary>
        /// Deserialize fields in this class from a stream.
        /// </summary>
        /// <param name="stream">Stream contains a serialized instance of this class.</param>
        /// <param name="size">The number of bytes can read if -1, no limitation. MUST be -1.</param>
        /// <returns>Bytes have been read from the stream.</returns>
        public override int Deserialize(Stream stream, int size)
        {
            int bytesRead = 0;

            this.sizedXidList = new List<SizedXid>();
            while (((size >= 0) && bytesRead < size)
                || (size < 0 && stream.Position != stream.Length))
            {
                SizedXid xid = new SizedXid();
                bytesRead += xid.Deserialize(stream, -1);
                this.sizedXidList.Add(xid);
            }

            return bytesRead;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Deserialize fields in this class from a stream.
        /// </summary>
        /// <param name="stream">Stream contains a serialized instance of this class.</param>
        /// <param name="size">The number of bytes can read if -1, no limitation. MUST be -1.</param>
        /// <returns>Bytes have been read from the stream.</returns>
        public override int Deserialize(Stream stream, int size)
        {
            int bytesRead = 0;

            this.sizedXidList = new List <SizedXid>();
            while (((size >= 0) && bytesRead < size) ||
                   (size < 0 && stream.Position != stream.Length))
            {
                SizedXid xid = new SizedXid();
                bytesRead += xid.Deserialize(stream, -1);
                this.sizedXidList.Add(xid);
            }

            return(bytesRead);
        }