private static void decodeRecords(DnsRecordDecoder decoder, DnsQuery query, DnsSection section,
                                      ByteBuf buf, int count) throws Exception {
        for (int i = count; i > 0; --i) {
            final DnsRecord r = decoder.decodeRecord(buf);
            if (r == null) {
                break;
            }
            query.addRecord(section, r);
        }
    }
Provides some utility methods for DNS message implementations.
core/src/test/java/com/linecorp/armeria/client/endpoint/dns/DnsMessageUtil.java