org.apache.directory.server.dns.io.encoder
Class ResourceRecordEncoder
java.lang.Object
org.apache.directory.server.dns.io.encoder.ResourceRecordEncoder
- All Implemented Interfaces:
- RecordEncoder
- Direct Known Subclasses:
- AddressRecordEncoder, CanonicalNameRecordEncoder, MailExchangeRecordEncoder, NameServerRecordEncoder, PointerRecordEncoder, ServerSelectionRecordEncoder, StartOfAuthorityRecordEncoder, TextRecordEncoder
public abstract class ResourceRecordEncoder
- extends java.lang.Object
- implements RecordEncoder
Method Summary |
void |
encode(ByteBuffer out,
ResourceRecord record)
|
protected byte[] |
encodeCharacterString(java.lang.String characterString)
is a single length octet followed by that number
of characters. |
protected void |
encodeDomainName(ByteBuffer byteBuffer,
java.lang.String domainName)
is a domain name represented as a series of labels, and
terminated by a label with zero length. |
protected byte[] |
encodeDomainName(java.lang.String domainName)
is a domain name represented as a series of labels, and
terminated by a label with zero length. |
protected void |
encodeRecordClass(ByteBuffer byteBuffer,
RecordClass recordClass)
|
protected void |
encodeRecordType(ByteBuffer byteBuffer,
RecordType recordType)
|
protected abstract byte[] |
encodeResourceData(ResourceRecord record)
|
protected void |
putUnsignedByte(ByteBuffer byteBuffer,
int value)
|
protected void |
putUnsignedByte(ByteBuffer byteBuffer,
int position,
int value)
|
protected void |
putUnsignedInt(ByteBuffer byteBuffer,
int position,
long value)
|
protected void |
putUnsignedInt(ByteBuffer byteBuffer,
long value)
|
protected void |
putUnsignedShort(ByteBuffer byteBuffer,
int value)
|
protected void |
putUnsignedShort(ByteBuffer byteBuffer,
int position,
int value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceRecordEncoder
public ResourceRecordEncoder()
encodeResourceData
protected abstract byte[] encodeResourceData(ResourceRecord record)
encode
public void encode(ByteBuffer out,
ResourceRecord record)
throws java.io.IOException
- Specified by:
encode
in interface RecordEncoder
- Throws:
java.io.IOException
encodeDomainName
protected byte[] encodeDomainName(java.lang.String domainName)
- is a domain name represented as a series of labels, and
terminated by a label with zero length.
- Parameters:
domainName
- the domain name to encode
- Returns:
- byte array of the encoded domain name
encodeDomainName
protected void encodeDomainName(ByteBuffer byteBuffer,
java.lang.String domainName)
- is a domain name represented as a series of labels, and
terminated by a label with zero length.
- Parameters:
byteBuffer
- the ByteBuffer to encode the domain name intodomainName
- the domain name to encode
encodeRecordType
protected void encodeRecordType(ByteBuffer byteBuffer,
RecordType recordType)
encodeRecordClass
protected void encodeRecordClass(ByteBuffer byteBuffer,
RecordClass recordClass)
encodeCharacterString
protected byte[] encodeCharacterString(java.lang.String characterString)
- is a single length octet followed by that number
of characters. is treated as binary information,
and can be up to 256 characters in length (including the length octet).
- Parameters:
characterString
- the character string to encode
- Returns:
- byte array of the encoded character string
putUnsignedByte
protected void putUnsignedByte(ByteBuffer byteBuffer,
int value)
putUnsignedByte
protected void putUnsignedByte(ByteBuffer byteBuffer,
int position,
int value)
putUnsignedShort
protected void putUnsignedShort(ByteBuffer byteBuffer,
int value)
putUnsignedShort
protected void putUnsignedShort(ByteBuffer byteBuffer,
int position,
int value)
putUnsignedInt
protected void putUnsignedInt(ByteBuffer byteBuffer,
long value)
putUnsignedInt
protected void putUnsignedInt(ByteBuffer byteBuffer,
int position,
long value)