コード例 #1
0
        private void DeserializeUpdate(ByteString data, TypeRegistry typeRegistry, Frame previousFrame)
        {
            using (var codedStream = new CodedInputStream(data.ToByteArray()))
            {
                var objectId     = ObjectUpdate.DeserializeObjectId(codedStream);
                var serialNumber = ObjectUpdate.DeserializeSerialNumber(codedStream);
                var typeId       = ObjectUpdate.DeserializeTypeId(codedStream);

                var metaData = typeRegistry.FindMetaDataByTransmitterId(typeId);

                var previousUpdate = previousFrame?.FindUpdateByObjectId(objectId);

                var update = ObjectUpdate.DeserializeFromStream(codedStream, new ObjectHandle(objectId, serialNumber), metaData, previousUpdate);

                _updates.Add(update);
            }
        }