(DNSInput in)
| 142 | } |
| 143 | |
| 144 | void |
| 145 | rrFromWire(DNSInput in) throws IOException { |
| 146 | elements = new ArrayList(1); |
| 147 | while (in.remaining() != 0) { |
| 148 | int family = in.readU16(); |
| 149 | int prefix = in.readU8(); |
| 150 | int length = in.readU8(); |
| 151 | boolean negative = (length & 0x80) != 0; |
| 152 | length &= ~0x80; |
| 153 | |
| 154 | byte [] data = in.readByteArray(length); |
| 155 | Element element; |
| 156 | if (!validatePrefixLength(family, prefix)) { |
| 157 | throw new WireParseException("invalid prefix length"); |
| 158 | } |
| 159 | |
| 160 | if (family == Address.IPv4 || family == Address.IPv6) { |
| 161 | data = parseAddress(data, |
| 162 | Address.addressLength(family)); |
| 163 | InetAddress addr = InetAddress.getByAddress(data); |
| 164 | element = new Element(negative, addr, prefix); |
| 165 | } else { |
| 166 | element = new Element(family, negative, data, prefix); |
| 167 | } |
| 168 | elements.add(element); |
| 169 | |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | void |
| 174 | rdataFromString(Tokenizer st, Name origin) throws IOException { |
nothing calls this directly
no test coverage detected