(type, data)
| 190 | this.writeU8(0); |
| 191 | } |
| 192 | writeRData(type, data) { |
| 193 | if (!data) |
| 194 | return; |
| 195 | |
| 196 | if (data instanceof Uint8Array) |
| 197 | this.writeBytes(data); |
| 198 | else if (DNS.RR.PTR === type) |
| 199 | this.writeName(data.name); |
| 200 | else if (DNS.RR.NSEC === type) { |
| 201 | this.writeName(data.next); |
| 202 | this.writeBytes(data.bitmaps); |
| 203 | } |
| 204 | else if (DNS.RR.SRV === type) { |
| 205 | this.writeU16(data.priority); |
| 206 | this.writeU16(data.weight); |
| 207 | this.writeU16(data.port); |
| 208 | this.writeName(data.target); |
| 209 | } |
| 210 | else |
| 211 | this.writeBytes(data); |
| 212 | } |
| 213 | writeRecord(record) { |
| 214 | this.writeName(record.name); |
| 215 | this.writeU16(record.type); |
no test coverage detected