java.lang.Object
org.minidns.record.Data
org.minidns.record.OPT
Field Summary
FieldsModifier and TypeFieldDescriptionfinal List<EdnsOption> EDNS options this record carries, stored unmodifiable.Constructor Summary
ConstructorsConstructorDescriptionOPT()Creates an OPT pseudo-record carrying no options.OPT(List<EdnsOption> variablePart) Creates an OPT pseudo-record carrying the given EDNS options.Method Summary
Modifier and TypeMethodDescriptiongetType()Reports this record as the OPT pseudo-record type.static OPTparse(DataInputStream dis, int payloadLength) Reads the EDNS options from a bounded stretch of the message.protected voidWrites each EDNS option to the wire in order.Methods inherited from class Data
equals, hashCode, length, toByteArray, toOutputStream, toOutputStreamModifier and TypeMethodDescriptionfinal booleanfinal inthashCode()final intlength()Serialize this record, if that has not been done already, and report the resulting wire size.final byte[]Serialize this record, if that has not been done already, and return a copy of the result so callers cannot mutate the cached bytes.final voidWrite the binary representation of this payload to the givenDataOutputStream.final voidtoOutputStream(OutputStream outputStream) Write the binary representation to the given OutputStream.
Field Details
variablePart
EDNS options this record carries, stored unmodifiable.
Constructor Details
OPT
public OPT()Creates an OPT pseudo-record carrying no options.OPT
Creates an OPT pseudo-record carrying the given EDNS options.- Parameters:
variablePart- the EDNS options this record carries, stored unmodifiable
Method Details
parse
Reads the EDNS options from a bounded stretch of the message.- Parameters:
dis- the stream to read the option payload frompayloadLength- the number of option payload bytes the record declares, which bounds the reads- Returns:
- an OPT record holding the options decoded from the stream
- Throws:
IOException- if the stream cannot be read, or an option's declared length runs past the payload
getType
Reports this record as the OPT pseudo-record type.serialize
Writes each EDNS option to the wire in order.- Specified by:
serializein classData- Parameters:
dos- the output stream to serialize to.- Throws:
IOException- if an I/O error occurs.