toBind static method

String toBind(
  1. RRecord record
)

Converts the record to the BIND representation.

Implementation

static String toBind(RRecord record) {
  var sb = StringBuffer();
  sb.write(record.name);
  if (sb.length < 8) {
    sb.write('\t');
  }
  if (sb.length < 16) {
    sb.write('\t');
  }
  sb.write('\t');
  sb.write(record.ttl);
  sb.write('\tIN\t');
  sb.write(intToRRecordType(record.rType)
      .toString()
      .substring('RRecordType.'.length));

  sb.write('\t');
  sb.write('\"');
  sb.write(record.data);
  sb.write('\"');

  return sb.toString();
}