Пример #1
0
        internal static Txt Get(BinaryReader reader)
        {
            Txt    txt = new Txt();
            ushort byteCount = BinaryHelper.ReadUInt16(reader), byteRead = 0;

            while (byteRead < byteCount)
            {
                byte propertyLength = reader.ReadByte();
                byteRead += (ushort)(propertyLength + 1);
                txt.AddProperty(Encoding.UTF8.GetString(reader.ReadBytes(propertyLength), 0, propertyLength));
            }
            return(txt);
        }
Пример #2
0
        internal static ResponseData Get(Type type, BackReferenceBinaryReader reader)
        {
            switch (type)
            {
            case Type.A:
            case Type.AAAA:
                return(HostAddress.Get(reader));

            case Type.NS:
                break;

            case Type.MD:
                break;

            case Type.MF:
                break;

            case Type.CNAME:
                return(CName.Get(reader));

            case Type.SOA:
                break;

            case Type.MB:
                break;

            case Type.MG:
                break;

            case Type.MR:
                break;

            case Type.NULL:
                break;

            case Type.WKS:
                break;

            case Type.PTR:
                return(Ptr.Get(reader));

            case Type.HINFO:
                break;

            case Type.MINFO:
                break;

            case Type.MX:
                break;

            case Type.TXT:
                return(Txt.Get(reader));

            case Type.SRV:
                return(Srv.Get(reader));

            default:
                break;
            }

            return(UnknownResponseData.Get(reader));
        }