private static void DecodingConvert(BinaryReader br, ref object obj, TTLVStructNode node, int valueLength) { byte[] valueBuffer = new byte[valueLength]; br.Read(valueBuffer, 0, valueBuffer.Length); object memberValue = node.GetValue(obj); object value = node.Converter.ConvertBackObject(node.Tag, valueBuffer, memberValue, node.GetMemberType(), node.ConverterPara); SetTTLVNodeValue(obj, node, value); }
private static void DecodingIList(BinaryReader br, ref object obj, TTLVStructNode node, int valueLength) { var list = (IList)node.GetValue(obj); if (list == null) { list = (IList)node.CreateMemberInstance(); SetTTLVNodeValue(obj, node, list); } DecodingCollection(list, br, node, valueLength); }
private static void DecodingObject(BinaryReader br, ref object obj, TTLVStructNode node, int valueLength) { var obj2 = node.GetValue(obj); if (obj2 == null) { obj2 = node.CreateMemberInstance(); SetTTLVNodeValue(obj, node, obj2); } var endPosition = br.BaseStream.Position + valueLength; var childs = GetTTLVStructNodeChilds(node); PrimitiveDecoding(br, endPosition, ref obj2, childs); br.BaseStream.Position = endPosition; }