public override byte[] BodyWriteTo() { BinaryWriter aDest = new BinaryWriter(new MemoryStream()); DNSPacket.GenerateName(aDest, this.fTargetName); aDest.Flush(); byte[] buffer = (aDest.BaseStream as MemoryStream).ToArray(); aDest.Close(); return(buffer); }
public void WriteTo(BinaryWriter aDest) { DNSPacket.GenerateName(aDest, this.fName); aDest.Write(DNSPacket.H2N((ushort)this.fType)); if (this.fClearCache) { aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000)))); } else { aDest.Write(DNSPacket.H2N((ushort)this.fClass)); } }
public void WriteTo(BinaryWriter aDest) { DNSPacket.GenerateName(aDest, this.fName); aDest.Write(DNSPacket.H2N((ushort)this.Type)); if (this.fClearCache) { aDest.Write(DNSPacket.H2N((ushort)(this.fClass | ((DNSClass)0x8000)))); } else { aDest.Write(DNSPacket.H2N((ushort)this.fClass)); } byte[] buffer = this.BodyWriteTo(); aDest.Write(DNSPacket.H2N((uint)this.fTTL)); aDest.Write(DNSPacket.H2N((ushort)buffer.Length)); aDest.Write(buffer, 0, buffer.Length); }