public String toString(String other) { return toString("record", ttl + "/" + getRemainingTTL(System.currentTimeMillis()) + "," + other); } }
void writeRecord(DNSRecord rec, long now) throws IOException { int save = off; try { writeName(rec.name); writeShort(rec.type); writeShort(rec.clazz | ((rec.unique && multicast) ? DNSConstants.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.ttl : rec.getRemainingTTL(now)); writeShort(0); int start = off; rec.write(this); int len = off - start; data[start - 2] = (byte) (len >> 8); data[start - 1] = (byte) (len & 0xFF); } catch (IOException e) { off = save; throw e; } }