Deserialize() 공개 메소드

public Deserialize ( Stream stream ) : void
stream Stream
리턴 void
예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PacketClientMsg"/> class.
        /// </summary>
        /// <param name="eMsg">The network message type for this packet message.</param>
        /// <param name="data">The data.</param>
        public PacketClientMsg( EMsg eMsg, byte[] data )
        {
            MsgType = eMsg;
            payload = data;

            ExtendedClientMsgHdr extendedHdr = new ExtendedClientMsgHdr();

            // deserialize the extended header to get our hands on the job ids
            using ( MemoryStream ms = new MemoryStream( data ) )
            {
                extendedHdr.Deserialize( ms );
            }

            TargetJobID = extendedHdr.TargetJobID;
            SourceJobID = extendedHdr.SourceJobID;
        }