Esempio n. 1
0
        public override byte[] GetBytes()
        {
            DnsWriter bw = new DnsWriter();
            bw.Write(_ipAddress.GetAddressBytes());

            return bw.GetBytes();
        }
Esempio n. 2
0
        public override byte[] GetBytes()
        {
            DnsWriter bw = new DnsWriter();

            bw.Write(_ipAddress.GetAddressBytes());

            return(bw.GetBytes());
        }
Esempio n. 3
0
        public byte[] ToArray()
        {
            DnsWriter byteWriter = new DnsWriter();

            // Header
            Header.WriteBytes(byteWriter);

            // Question, Answer, Authority, Additional Counts
            byteWriter.Write((short)this.QuestionRecordCount);
            byteWriter.Write((short)this.AnswerRecordCount);
            byteWriter.Write((short)this.AuthorityRecordCount);
            byteWriter.Write((short)this.AdditionalRecordCount);

            // Write Records
            foreach (Question record in Questions)
            {
                record.Write(byteWriter);
            }

            foreach (Answer record in Answers)
            {
                record.Write(byteWriter);
            }

            foreach (Authority record in Authorities)
            {
                record.Write(byteWriter);
            }

            foreach (Additional record in Additionals)
            {
                record.Write(byteWriter);
            }

            return(byteWriter.GetBytes());
        }
Esempio n. 4
0
        public byte[] ToArray()
        {
            DnsWriter byteWriter = new DnsWriter();

            // Header
            Header.WriteBytes(byteWriter);

            // Question, Answer, Authority, Additional Counts
            byteWriter.Write((short)this.QuestionRecordCount);
            byteWriter.Write((short)this.AnswerRecordCount);
            byteWriter.Write((short)this.AuthorityRecordCount);
            byteWriter.Write((short)this.AdditionalRecordCount);

            // Write Records
            foreach (Question record in Questions)
            {
                record.Write(byteWriter);
            }

            foreach (Answer record in Answers)
            {
                record.Write(byteWriter);
            }

            foreach (Authority record in Authorities)
            {
                record.Write(byteWriter);
            }

            foreach (Additional record in Additionals)
            {
                record.Write(byteWriter);
            }

            return byteWriter.GetBytes();
        }