private DnsRDataMg(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.mgMName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMb(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.maDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataCName(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.cName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataNs(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.nsDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMf(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.maDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMr(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.newName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMd(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.maDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataPtr(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.ptrDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMInfo(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.rMailBx = DnsDomainName.newInstance(rawData, offset, length); int rMailBxLen = rMailBx.length(); if (rMailBxLen == length) { StringBuilder sb = new StringBuilder(200); sb.append("The data is too short to build eMailBx in DnsRDataMInfo. data: ") .append(ByteArrays.toHexString(rawData, " ")) .append(", offset: ") .append(offset) .append(", length: ") .append(length); throw new IllegalRawDataException(sb.toString()); } this.eMailBx = DnsDomainName.newInstance(rawData, offset + rMailBxLen, length - rMailBxLen); }
private DnsRDataMx(byte[] rawData, int offset, int length) throws IllegalRawDataException { if (length < SHORT_SIZE_IN_BYTES + 1) { StringBuilder sb = new StringBuilder(200); sb.append("The data is too short to build a DnsRDataMx (") .append(SHORT_SIZE_IN_BYTES + 1) .append(" bytes at least). data: ") .append(ByteArrays.toHexString(rawData, " ")) .append(", offset: ") .append(offset) .append(", length: ") .append(length); throw new IllegalRawDataException(sb.toString()); } this.preference = ByteArrays.getShort(rawData, offset); this.exchange = DnsDomainName.newInstance( rawData, offset + SHORT_SIZE_IN_BYTES, length - SHORT_SIZE_IN_BYTES); }
private DnsQuestion(byte[] rawData, int offset, int length) throws IllegalRawDataException { int cursor = 0; this.qName = DnsDomainName.newInstance(rawData, offset, length); cursor += qName.length(); if (length - cursor < SHORT_SIZE_IN_BYTES * 2) { StringBuilder sb = new StringBuilder(200); sb.append("The data is too short to build qType an qClass of DnsQuestion. data: ") .append(ByteArrays.toHexString(rawData, " ")) .append(", offset: ") .append(offset) .append(", length: ") .append(length) .append(", cursor: ") .append(cursor); throw new IllegalRawDataException(sb.toString()); } this.qType = DnsResourceRecordType.getInstance(ByteArrays.getShort(rawData, offset + cursor)); cursor += SHORT_SIZE_IN_BYTES; this.qClass = DnsClass.getInstance(ByteArrays.getShort(rawData, offset + cursor)); }
private DnsRDataSoa(byte[] rawData, int offset, int length) throws IllegalRawDataException { int cursor = 0; this.mName = DnsDomainName.newInstance(rawData, offset, length); int mNameLen = mName.length(); cursor += mNameLen; this.rName = DnsDomainName.newInstance(rawData, offset + cursor, length - cursor); int rNameLen = rName.length(); cursor += rNameLen;
private DnsResourceRecord(byte[] rawData, int offset, int length) throws IllegalRawDataException { int cursor = 0; this.name = DnsDomainName.newInstance(rawData, offset, length); cursor += name.length();
private DnsRDataPtr(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.ptrDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMd(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.maDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMg(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.mgMName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMb(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.maDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataNs(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.nsDName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataCName(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.cName = DnsDomainName.newInstance(rawData, offset, length); }
private DnsRDataMInfo(byte[] rawData, int offset, int length) throws IllegalRawDataException { this.rMailBx = DnsDomainName.newInstance(rawData, offset, length); int rMailBxLen = rMailBx.length(); if (rMailBxLen == length) { StringBuilder sb = new StringBuilder(200); sb.append("The data is too short to build eMailBx in DnsRDataMInfo. data: ") .append(ByteArrays.toHexString(rawData, " ")) .append(", offset: ") .append(offset) .append(", length: ") .append(length); throw new IllegalRawDataException(sb.toString()); } this.eMailBx = DnsDomainName.newInstance(rawData, offset + rMailBxLen, length - rMailBxLen); }