我有以下代码从arraylist反序列化一个元素,我不确定DeserializeObject方法在反序列化时是否也会从arraylist中删除该元素?每次序列化后是否需要添加 recvJsonBuffer.RemoveAt(0) ?
List<Json> entities = (List<Json>)JavaScriptConvert.DeserializeObject(recvJsonBuffer[0].ToString(), typeof(List<Json>));
foreach (Json obj in entities)
{
trace_idBuffer = obj.traceid;
plain_tagidBuffer = obj.Plain_tagID;
national_codeBuffer = obj.National_Code;
country_codeBuffer = obj.Country_Code;
res_codeBuffer = obj.Res_Code;
exp_codeBuffer = obj.Exp_Code;
reader_idBuffer = obj.Device;
data_sourceBuffer = obj.Datasource;
// recvJsonBuffer.RemoveAt(0);
}