Class PresentationWriter
Methods to write DNS data items encoded in the presentation (text) format.
Inherited Members
Namespace: Makaretu.Dns
Assembly: Makaretu.Dns.dll
Syntax
public class PresentationWriter
Constructors
| Improve this Doc View SourcePresentationWriter(TextWriter)
Creates a new instance of the PresentationWriter using the specified TextWriter.
Declaration
public PresentationWriter(TextWriter text)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | text | The source for data items. |
Methods
| Improve this Doc View SourceWriteBase16String(Byte[], Boolean)
Write bytes encoded in base-16.
Declaration
public void WriteBase16String(byte[] value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteBase64String(Byte[], Boolean)
Write bytes encoded in base-64.
Declaration
public void WriteBase64String(byte[] value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteByte(Byte, Boolean)
Write an byte.
Declaration
public void WriteByte(byte value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
Byte | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteDateTime(DateTime, Boolean)
Write a date/time.
Declaration
public void WriteDateTime(DateTime value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
DateTime | value | The UTC DateTime. Resolution is seconds. |
Boolean | appendSpace | Write a space after the value. |
WriteDnsClass(DnsClass, Boolean)
Write a DNS Class.
Declaration
public void WriteDnsClass(DnsClass value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
DnsClass | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
Remarks
Either the name of a DnsClass or the string "CLASSx".
WriteDnsType(DnsType, Boolean)
Write a DNS Type.
Declaration
public void WriteDnsType(DnsType value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
DnsType | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
Remarks
Either the name of a DnsType or the string "TYPEx".
WriteDomainName(DomainName, Boolean)
Write a domain name.
Declaration
public void WriteDomainName(DomainName value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
DomainName | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteEndOfLine()
Writes a CRLF.
Declaration
public void WriteEndOfLine()
WriteIPAddress(IPAddress, Boolean)
Write an Internet address.
Declaration
public void WriteIPAddress(IPAddress value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
IPAddress | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteSpace()
Writes a space.
Declaration
public void WriteSpace()
WriteString(String, Boolean)
Write a string.
Declaration
public void WriteString(string value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
String | value | An ASCII string. |
Boolean | appendSpace | Write a space after the value. |
Remarks
Quotes and escapes are added as needned.
WriteStringUnencoded(String, Boolean)
Write a string.
Declaration
public void WriteStringUnencoded(string value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
String | value | An ASCII string. |
Boolean | appendSpace | Write a space after the value. |
Remarks
Quotes and escapes are NOT added.
WriteTimeSpan16(TimeSpan, Boolean)
Write a time span (interval) in 16-bit seconds.
Declaration
public void WriteTimeSpan16(TimeSpan value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | value | The number of seconds to write. |
Boolean | appendSpace | Write a space after the value. |
WriteTimeSpan32(TimeSpan, Boolean)
Write a time span (interval) in 32-bit seconds.
Declaration
public void WriteTimeSpan32(TimeSpan value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | value | The number of seconds to write. |
Boolean | appendSpace | Write a space after the value. |
WriteUInt16(UInt16, Boolean)
Write an unsigned short.
Declaration
public void WriteUInt16(ushort value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
UInt16 | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |
WriteUInt32(UInt32, Boolean)
Write an unsigned int.
Declaration
public void WriteUInt32(uint value, bool appendSpace = true)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | value | The value to write. |
Boolean | appendSpace | Write a space after the value. |