| 173 | } |
| 174 | |
| 175 | static Record |
| 176 | fromWire(DNSInput in, int section, boolean isUpdate) throws IOException { |
| 177 | int type, dclass; |
| 178 | long ttl; |
| 179 | int length; |
| 180 | Name name; |
| 181 | Record rec; |
| 182 | |
| 183 | name = new Name(in); |
| 184 | type = in.readU16(); |
| 185 | dclass = in.readU16(); |
| 186 | |
| 187 | if (section == Section.QUESTION) |
| 188 | return newRecord(name, type, dclass); |
| 189 | |
| 190 | ttl = in.readU32(); |
| 191 | length = in.readU16(); |
| 192 | if (length == 0 && isUpdate && |
| 193 | (section == Section.PREREQ || section == Section.UPDATE)) |
| 194 | return newRecord(name, type, dclass, ttl); |
| 195 | rec = newRecord(name, type, dclass, ttl, length, in); |
| 196 | return rec; |
| 197 | } |
| 198 | |
| 199 | static Record |
| 200 | fromWire(DNSInput in, int section) throws IOException { |