Example #1
0
File: TLV.cs Project: steffex/eVR
        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);
        }
Example #2
0
 protected string DecodeString(TLV tag)
 {
     return (tag == null) ? string.Empty : Helper.DecodeString(tag.Value, this.CharacterSetEncoding);
 }
Example #3
0
 protected string DecodeBinary(TLV tag)
 {
     return (tag == null) ? null : Helper.DecodeBinairy(tag.Value);
 }
Example #4
0
File: TLV.cs Project: darko0201/eVR
        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;
        }
Example #5
0
File: TLV.cs Project: darko0201/eVR
        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;
        }