@Override void write(MessageOutputStream out) { out.writeShort(_priority); out.writeShort(_weight); out.writeShort(_port); if (DNSIncoming.USE_DOMAIN_NAME_FORMAT_FOR_SRV_TARGET) { out.writeName(_server); } else { // [PJYF Nov 13 2010] Do we still need this? This looks really bad. All label are supposed to start by a length. out.writeUTF(_server, 0, _server.length()); // add a zero byte to the end just to be safe, this is the strange form // used by the BonjourConformanceTest out.writeByte(0); } }
@Override void write(MessageOutputStream out) { out.writeShort(_priority); out.writeShort(_weight); out.writeShort(_port); if (DNSIncoming.USE_DOMAIN_NAME_FORMAT_FOR_SRV_TARGET) { out.writeName(_server); } else { // [PJYF Nov 13 2010] Do we still need this? This looks really bad. All label are supposed to start by a length. out.writeUTF(_server, 0, _server.length()); // add a zero byte to the end just to be safe, this is the strange form // used by the BonjourConformanceTest out.writeByte(0); } }
@Override void write(MessageOutputStream out) { out.writeShort(_priority); out.writeShort(_weight); out.writeShort(_port); if (DNSIncoming.USE_DOMAIN_NAME_FORMAT_FOR_SRV_TARGET) { out.writeName(_server); } else { // [PJYF Nov 13 2010] Do we still need this? This looks really bad. All label are supposed to start by a length. out.writeUTF(_server, 0, _server.length()); // add a zero byte to the end just to be safe, this is the strange form // used by the BonjourConformanceTest out.writeByte(0); } }
/** * Builds the final message buffer to be send and returns it. * * @return bytes to send. */ public byte[] data() { long now = System.currentTimeMillis(); // System.currentTimeMillis() _names.clear(); MessageOutputStream message = new MessageOutputStream(_maxUDPPayload, this); message.writeShort(_multicast ? 0 : this.getId()); message.writeShort(this.getFlags()); message.writeShort(this.getNumberOfQuestions()); message.writeShort(this.getNumberOfAnswers()); message.writeShort(this.getNumberOfAuthorities()); message.writeShort(this.getNumberOfAdditionals()); for (DNSQuestion question : _questions) { message.writeQuestion(question); } for (DNSRecord record : _answers) { message.writeRecord(record, now); } for (DNSRecord record : _authoritativeAnswers) { message.writeRecord(record, now); } for (DNSRecord record : _additionals) { message.writeRecord(record, now); } return message.toByteArray(); }
message.writeShort(_multicast ? 0 : this.getId()); message.writeShort(this.getFlags()); message.writeShort(this.getNumberOfQuestions()); message.writeShort(this.getNumberOfAnswers()); message.writeShort(this.getNumberOfAuthorities()); message.writeShort(this.getNumberOfAdditionals()); for (DNSQuestion question : _questions) { message.writeQuestion(question);
/** * Builds the final message buffer to be send and returns it. * * @return bytes to send. */ public byte[] data() { long now = System.currentTimeMillis(); // System.currentTimeMillis() _names.clear(); MessageOutputStream message = new MessageOutputStream(_maxUDPPayload, this); message.writeShort(_multicast ? 0 : this.getId()); message.writeShort(this.getFlags()); message.writeShort(this.getNumberOfQuestions()); message.writeShort(this.getNumberOfAnswers()); message.writeShort(this.getNumberOfAuthorities()); message.writeShort(this.getNumberOfAdditionals()); for (DNSQuestion question : _questions) { message.writeQuestion(question); } for (DNSRecord record : _answers) { message.writeRecord(record, now); } for (DNSRecord record : _authoritativeAnswers) { message.writeRecord(record, now); } for (DNSRecord record : _additionals) { message.writeRecord(record, now); } return message.toByteArray(); }
/** * Builds the final message buffer to be send and returns it. * * @return bytes to send. */ public byte[] data() { long now = System.currentTimeMillis(); // System.currentTimeMillis() _names.clear(); MessageOutputStream message = new MessageOutputStream(_maxUDPPayload, this); message.writeShort(_multicast ? 0 : this.getId()); message.writeShort(this.getFlags()); message.writeShort(this.getNumberOfQuestions()); message.writeShort(this.getNumberOfAnswers()); message.writeShort(this.getNumberOfAuthorities()); message.writeShort(this.getNumberOfAdditionals()); for (DNSQuestion question : _questions) { message.writeQuestion(question); } for (DNSRecord record : _answers) { message.writeRecord(record, now); } for (DNSRecord record : _authoritativeAnswers) { message.writeRecord(record, now); } for (DNSRecord record : _additionals) { message.writeRecord(record, now); } return message.toByteArray(); }
@Override void write(MessageOutputStream out) { out.writeShort(_priority); out.writeShort(_weight); out.writeShort(_port); if (DNSIncoming.USE_DOMAIN_NAME_FORMAT_FOR_SRV_TARGET) { out.writeName(_server); } else { // [PJYF Nov 13 2010] Do we still need this? This looks really bad. All label are supposed to start by a length. out.writeUTF(_server, 0, _server.length()); // add a zero byte to the end just to be safe, this is the strange form // used by the BonjourConformanceTest out.writeByte(0); } }
void writeInt(int value) { writeShort(value >> 16); writeShort(value); }
void writeInt(int value) { writeShort(value >> 16); writeShort(value); }
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 writeQuestion(DNSQuestion question) { writeName(question.getName()); writeShort(question.getRecordType().indexValue()); writeShort(question.getRecordClass().indexValue()); }
void writeQuestion(DNSQuestion question) { writeName(question.getName()); writeShort(question.getRecordType().indexValue()); writeShort(question.getRecordClass().indexValue()); }
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 writeQuestion(DNSQuestion question) { writeName(question.getName()); writeShort(question.getRecordType().indexValue()); writeShort(question.getRecordClass().indexValue()); }
void writeQuestion(DNSQuestion question) { writeName(question.getName()); writeShort(question.getRecordType().indexValue()); writeShort(question.getRecordClass().indexValue()); }
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 writeInt(int value) { writeShort(value >> 16); writeShort(value); }
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 writeInt(int value) { writeShort(value >> 16); writeShort(value); }