public void decode(Buffer buffer, int nbRecords) throws IOException
{
for (int i = 0; i < nbRecords; i++)
{
Name name = getMessage().getCompression().decodeName(buffer);
Type type = Type.getType(BufferUtil.get16(buffer));
DnsClass clazz = DnsClass.getClass(BufferUtil.get16(buffer));
Record record = type.newRecord();
record.setName(name);
record.setDnsClass(clazz);
record.setTtl(BufferUtil.getInt(buffer));
int dataLength = BufferUtil.get16(buffer);
record.doDecode(buffer, getMessage().getCompression(), dataLength);