private static TLVList ParseTagList(byte[] data) { TLVList tagList = new TLVList(); MemoryStream ms = new MemoryStream(data); while (ms.Position < ms.Length) { TLV tlv = new TLV(ms); if (tlv.Value != null && tlv.Value.Length > 0) { if (tlv.isConstructed) { tlv.Childs = TLV.ParseTagList(tlv.Value); } tagList.Add(tlv); } } return(tagList); }
protected string DecodeString(TLV tag) { return (tag == null) ? string.Empty : Helper.DecodeString(tag.Value, this.CharacterSetEncoding); }
protected string DecodeBinary(TLV tag) { return (tag == null) ? null : Helper.DecodeBinairy(tag.Value); }
private static TLVList ParseTagList(byte[] data) { TLVList tagList = new TLVList(); MemoryStream ms = new MemoryStream(data); while (ms.Position < ms.Length) { TLV tlv = new TLV(ms); if (tlv.Value != null && tlv.Value.Length > 0) { if (tlv.isConstructed) { tlv.Childs = TLV.ParseTagList(tlv.Value); } tagList.Add(tlv); } } return tagList; }
public static TLVList Parse(Stream s) { TLVList l = new TLVList(); while (s.Position < s.Length) { TLV t = new TLV(s); t.Childs = TLV.ParseTagList(t.Value); l.Add(t); } return l; }