public class DnsMessageEncoder
extends java.lang.Object
encode(ByteBuffer, DnsMessage) method which will
write the message to the outgoing ByteBuffer according to the DnsMessage
encoding in RFC-1035.| Modifier and Type | Field and Description |
|---|---|
private static java.util.Map<RecordType,RecordEncoder> |
DEFAULT_ENCODERS
A Hashed Adapter mapping record types to their encoders.
|
private static org.slf4j.Logger |
LOG
the log for this class
|
| Constructor and Description |
|---|
DnsMessageEncoder() |
| Modifier and Type | Method and Description |
|---|---|
void |
encode(org.apache.mina.core.buffer.IoBuffer byteBuffer,
DnsMessage message)
Encodes the
DnsMessage into the IoBuffer. |
private byte |
encodeAuthoritativeAnswer(boolean authoritative) |
private byte |
encodeMessageType(MessageType messageType) |
private byte |
encodeOpCode(OpCode opCode) |
private byte |
encodeRecursionAvailable(boolean recursionAvailable) |
private byte |
encodeRecursionDesired(boolean recursionDesired) |
private byte |
encodeResponseCode(ResponseCode responseCode) |
private byte |
encodeTruncated(boolean truncated) |
private void |
put(org.apache.mina.core.buffer.IoBuffer byteBuffer,
ResourceRecord record) |
private void |
putQuestionRecords(org.apache.mina.core.buffer.IoBuffer byteBuffer,
java.util.List<QuestionRecord> questions) |
private void |
putResourceRecords(org.apache.mina.core.buffer.IoBuffer byteBuffer,
java.util.List<ResourceRecord> records) |
private static final org.slf4j.Logger LOG
private static final java.util.Map<RecordType,RecordEncoder> DEFAULT_ENCODERS
public void encode(org.apache.mina.core.buffer.IoBuffer byteBuffer,
DnsMessage message)
DnsMessage into the IoBuffer.byteBuffer - message - private void putQuestionRecords(org.apache.mina.core.buffer.IoBuffer byteBuffer,
java.util.List<QuestionRecord> questions)
private void putResourceRecords(org.apache.mina.core.buffer.IoBuffer byteBuffer,
java.util.List<ResourceRecord> records)
private void put(org.apache.mina.core.buffer.IoBuffer byteBuffer,
ResourceRecord record)
throws java.io.IOException
java.io.IOExceptionprivate byte encodeMessageType(MessageType messageType)
private byte encodeOpCode(OpCode opCode)
private byte encodeAuthoritativeAnswer(boolean authoritative)
private byte encodeTruncated(boolean truncated)
private byte encodeRecursionDesired(boolean recursionDesired)
private byte encodeRecursionAvailable(boolean recursionAvailable)
private byte encodeResponseCode(ResponseCode responseCode)