java.lang.Object
org.minidns.record.Data
org.minidns.record.UNKNOWN
DNS record payload for unknown or unsupported record types.
Provides raw byte-level access to record data when the specific record type is not recognized by the library.
Provides raw byte-level access to record data when the specific record type is not recognized by the library.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]The record's bytes, as read.private final Record.TYPEThe type this record stands for.Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUNKNOWN(DataInputStream dis, int payloadLength, Record.TYPE type) Reads a record of a type nothing else parses.Method Summary
Modifier and TypeMethodDescriptiongetType()Return the record type this payload was read under.static UNKNOWNparse(DataInputStream dis, int payloadLength, Record.TYPE type) Parse an unknown record from a stream.voidWrite the retained payload bytes verbatim to the stream.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
type
The type this record stands for.data
private final byte[] dataThe record's bytes, as read.
Constructor Details
UNKNOWN
Reads a record of a type nothing else parses.- Parameters:
dis- the stream to read frompayloadLength- the number of bytes to readtype- the unrecognized type- Throws:
IOException- if the reading fails
Method Details
getType
Return the record type this payload was read under.serialize
Write the retained payload bytes verbatim to the stream.- Specified by:
serializein classData- Parameters:
dos- the output stream to serialize to.- Throws:
IOException- if an I/O error occurs.
parse
public static UNKNOWN parse(DataInputStream dis, int payloadLength, Record.TYPE type) throws IOException Parse an unknown record from a stream.- Parameters:
dis- the stream positioned at the first byte of the record payloadpayloadLength- the payload size in bytes, read and retained verbatimtype- the record type the payload was read under- Returns:
- the record holding the raw payload bytes
- Throws:
IOException- if the stream ends before payloadLength bytes have been read