protected byte [] getDNSRecord(final long fetchStart, final Record[] rrecordSet) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Start the record with a 14-digit date per RFC 2540 byte[] fetchDate = ArchiveUtils.get14DigitDate(fetchStart).getBytes(); baos.write(fetchDate); // Don't forget the newline baos.write("\n".getBytes()); if (rrecordSet != null) { for (int i = 0; i < rrecordSet.length; i++) { byte[] record = rrecordSet[i].toString().getBytes(); baos.write(record); // Add the newline between records back in baos.write("\n".getBytes()); } } return baos.toByteArray(); }
private String convertRecordToString(Record record) { if (record == null) return null; String recordString = record.toString(); recordString = normalizeRecordString(recordString); return recordString; }
protected byte [] getDNSRecord(final long fetchStart, final Record[] rrecordSet) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); // Start the record with a 14-digit date per RFC 2540 byte[] fetchDate = ArchiveUtils.get14DigitDate(fetchStart).getBytes(); baos.write(fetchDate); // Don't forget the newline baos.write("\n".getBytes()); if (rrecordSet != null) { for (int i = 0; i < rrecordSet.length; i++) { byte[] record = rrecordSet[i].toString().getBytes(); baos.write(record); // Add the newline between records back in baos.write("\n".getBytes()); } } return baos.toByteArray(); }
public static void main(String[] args) throws TextParseException, IOException { File zoneFile = new File("zones/unlogic.se"); Master master = new Master(zoneFile.getPath(),Name.fromString(zoneFile.getName(), Name.root)); Record record = master._nextRecord(); Logger LOG = Logger.getLogger(ZoneDissasembler.class); while(record != null){ LOG.info("Class: " + record.getClass()); LOG.info("Name: " + record.getName()); LOG.info("toString: " + record.toString()); record = master._nextRecord(); } }
log.info("Record: {}", record.toString()); if (record.getType() == Type.SRV) { if (record instanceof SRVRecord) {
srvRecords.add((SRVRecord) record); } else { log.info("Got non-SRV record: {}", record.toString());