java.lang.Object
org.minidns.record.Data
org.minidns.record.UNKNOWN

public final class UNKNOWNextends Data
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.
  • Field Details

    • type

      private final Record.TYPE type
      The type this record stands for.
    • data

      private final byte[] data
      The record's bytes, as read.
  • Constructor Details

    • UNKNOWN

      private UNKNOWN(DataInputStream dis, int payloadLength, Record.TYPE type) throws IOException
      Reads a record of a type nothing else parses.
      Parameters:
      dis - the stream to read from
      payloadLength - the number of bytes to read
      type - the unrecognized type
      Throws:
      IOException - if the reading fails
  • Method Details

    • getType

      public Record.TYPE getType()
      Return the record type this payload was read under.
      Specified by:
      getType in class Data
      Returns:
      The DNS record type of this payload.
    • serialize

      public void serialize(DataOutputStream dos) throws IOException
      Write the retained payload bytes verbatim to the stream.
      Specified by:
      serialize in class Data
      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 payload
      payloadLength - the payload size in bytes, read and retained verbatim
      type - 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