public abstract class EdnsOption extends Object
| Modifier and Type | Field and Description |
|---|---|
int | optionCodeThe EDNS option code. |
protected byte[] | optionDataThe raw option data. |
int | optionLengthThe length of the option data. |
| Modifier | Constructor and Description |
|---|---|
protected | EdnsOption(byte[] optionData)EdnsOption. |
protected | EdnsOption(int optionCode,
byte[] optionData)Creates a new EDNS option with the specified option code and data. |
| Modifier and Type | Method and Description |
|---|---|
String | asTerminalOutput()Returns the terminal output representation of this EDNS option. |
protected abstract CharSequence | asTerminalOutputInternal()Returns the terminal output representation of this EDNS option. |
abstract Edns.OptionCode | getOptionCode()Returns the option code for this EDNS option. |
static EdnsOption | parse(int intOptionCode,
byte[] optionData)Parses an EDNS option from the specified option code and data. |
String | toString()toString. |
protected abstract CharSequence | toStringInternal()Returns the string representation of this EDNS option. |
void | writeToDos(DataOutputStream dos)Writes this EDNS option to the specified data output stream. |
public final int optionCode
protected final byte[] optionData
public final int optionLength
protected EdnsOption(byte[] optionData)
protected EdnsOption(int optionCode,
byte[] optionData)optionCode - the option codeoptionData - the option datapublic final String asTerminalOutput()
protected abstract CharSequence asTerminalOutputInternal()
public abstract Edns.OptionCode getOptionCode()
public static EdnsOption parse(int intOptionCode, byte[] optionData)
intOptionCode - the option code as an integeroptionData - the option dataprotected abstract CharSequence toStringInternal()
public final void writeToDos(DataOutputStream dos) throws IOException
dos - the data output stream to write toIOException - if an I/O error occurs