예제 #1
0
        /// <summary>
        ///   Write the textual representation of the data that is specific to
        ///   the resource record.
        /// </summary>
        /// <param name="writer">
        ///   The destination for the resource record's data.
        /// </param>
        /// <remarks>
        ///   Derived classes should implement this method.
        ///   <para>
        ///   By default, this will write the hex encoding of
        ///   the <see cref="GetData">RDATA</see> preceeded by
        ///   "\#" and the number integer bytes.
        ///   </para>
        /// </remarks>
        public virtual void WriteData(PresentationWriter writer)
        {
            var rdata   = GetData();
            var hasData = rdata.Length > 0;

            writer.WriteStringUnencoded("\\#");
            writer.WriteUInt32((uint)rdata.Length, appendSpace: hasData);
            if (hasData)
            {
                writer.WriteBase16String(rdata, appendSpace: false);
            }
        }