Ejemplo n.º 1
0
        private DnsResourceRecord ResolveTXTRecord(ResourceRecordInfo info)
        {
            int pos = _reader.Index;

            var values     = new List <string>();
            var utf8Values = new List <string>();

            while ((_reader.Index - pos) < info.RawDataLength)
            {
                var length  = _reader.ReadByte();
                var bytes   = _reader.ReadBytes(length);
                var escaped = DnsDatagramReader.ParseString(bytes);
                var utf     = DnsDatagramReader.ReadUTF8String(bytes);
                values.Add(escaped);
                utf8Values.Add(utf);
            }

            return(new TxtRecord(info, values.ToArray(), utf8Values.ToArray()));
        }