code: protected DnsRecord decodeRecord(
              String name, DnsRecordType type, int dnsClass, long timeToLive,
              ByteBuf in, int offset, int length) throws Exception {
  
          // DNS message compression means that domain names may contain "pointers" to other positions in the packet
          // to build a full message. This means the indexes are meaningful and we need the ability to reference the
          // indexes un-obstructed, and thus we cannot use a slice here.
          // See https://www.ietf.org/rfc/rfc1035 [4.1.4. Message compression]
          if (type == DnsRecordType.PTR) {
              return new DefaultDnsPtrRecord(
                      name, dnsClass, timeToLive, decodeName0(in.duplicate().setIndex(offset, offset + length)));
          }
          return new DefaultDnsRawRecord(
                  name, type, dnsClass, timeToLive, in.retainedDuplicate().setIndex(offset, offset + length));
      }
docs: Decodes a record from the information decoded so far by {@link #decodeRecord(ByteBuf)}.
  
  @param name the domain name of the record
  @param type the type of the record
  @param dnsClass the class of the record
  @param timeToLive the TTL of the record
  @param in the {@link ByteBuf} that contains the RDATA
  @param offset the start offset of the RDATA in {@code in}
  @param length the length of the RDATA
  
  @return a {@link DnsRawRecord}. Override this method to decode RDATA and return other record implementation.