/** * Add an authoritative answer to the message. * * @param rec * @exception IOException */ public void addAuthorativeAnswer(DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _authoritativeAnswers.add(rec); _authoritativeAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add a question to the message. * * @param rec * @exception IOException */ public void addQuestion(DNSQuestion rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeQuestion(rec); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _questions.add(rec); _questionsBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an additional answer to the record. Omit if there is no room. * * @param in * @param rec * @exception IOException */ public void addAdditionalAnswer(DNSIncoming in, DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _additionals.add(rec); _additionalsAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an answer to the message. * * @param rec * @param now * @exception IOException */ public void addAnswer(DNSRecord rec, long now) throws IOException { if (rec != null) { if ((now == 0) || !rec.isExpired(now)) { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, now); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _answers.add(rec); _answersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } } } }
/** * Add an answer to the message. * * @param rec * @param now * @exception IOException */ public void addAnswer(DNSRecord rec, long now) throws IOException { if (rec != null) { if ((now == 0) || !rec.isExpired(now)) { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, now); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _answers.add(rec); _answersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } } } }
/** * Add an answer to the message. * * @param rec * @param now * @exception IOException */ public void addAnswer(DNSRecord rec, long now) throws IOException { if (rec != null) { if ((now == 0) || !rec.isExpired(now)) { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, now); byte[] byteArray = record.toByteArray(); record.close(); if (byteArray.length < this.availableSpace()) { _answers.add(rec); _answersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } } } }
/** * Add an answer to the message. * * @param rec * @param now * @exception IOException */ public void addAnswer(DNSRecord rec, long now) throws IOException { if (rec != null) { if ((now == 0) || !rec.isExpired(now)) { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, now); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _answers.add(rec); _answersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } } } }
/** * Add an additional answer to the record. Omit if there is no room. * * @param in * @param rec * @exception IOException */ public void addAdditionalAnswer(DNSIncoming in, DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _additionals.add(rec); _additionalsAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add a question to the message. * * @param rec * @exception IOException */ public void addQuestion(DNSQuestion rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeQuestion(rec); byte[] byteArray = record.toByteArray(); record.close(); if (byteArray.length < this.availableSpace()) { _questions.add(rec); _questionsBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an authoritative answer to the message. * * @param rec * @exception IOException */ public void addAuthorativeAnswer(DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _authoritativeAnswers.add(rec); _authoritativeAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an authoritative answer to the message. * * @param rec * @exception IOException */ public void addAuthorativeAnswer(DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); record.close(); if (byteArray.length < this.availableSpace()) { _authoritativeAnswers.add(rec); _authoritativeAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an additional answer to the record. Omit if there is no room. * * @param in * @param rec * @exception IOException */ public void addAdditionalAnswer(DNSIncoming in, DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _additionals.add(rec); _additionalsAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add a question to the message. * * @param rec * @exception IOException */ public void addQuestion(DNSQuestion rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeQuestion(rec); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _questions.add(rec); _questionsBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an authoritative answer to the message. * * @param rec * @exception IOException */ public void addAuthorativeAnswer(DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _authoritativeAnswers.add(rec); _authoritativeAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add an additional answer to the record. Omit if there is no room. * * @param in * @param rec * @exception IOException */ public void addAdditionalAnswer(DNSIncoming in, DNSRecord rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeRecord(rec, 0); byte[] byteArray = record.toByteArray(); record.close(); if (byteArray.length < this.availableSpace()) { _additionals.add(rec); _additionalsAnswersBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
/** * Add a question to the message. * * @param rec * @exception IOException */ public void addQuestion(DNSQuestion rec) throws IOException { MessageOutputStream record = new MessageOutputStream(512, this); record.writeQuestion(rec); byte[] byteArray = record.toByteArray(); if (byteArray.length < this.availableSpace()) { _questions.add(rec); _questionsBytes.write(byteArray, 0, byteArray.length); } else { throw new IOException("message full"); } }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }