| 257 | } |
| 258 | |
| 259 | static Record readQuestion(ByteBuffer in) { |
| 260 | // System.out.println("RECORD: " + Packet.dump(in)); |
| 261 | int tell = in.position(); |
| 262 | try { |
| 263 | String name = readName(in); |
| 264 | int type = in.getShort() & 0xFFFF; |
| 265 | int clazz = in.getShort() & 0xFFFF; |
| 266 | return new Record(type, clazz, 0, name, null); |
| 267 | } catch (Exception e) { |
| 268 | ((Buffer)in).position(tell); |
| 269 | throw (RuntimeException)new RuntimeException("Failed reading record " + Packet.dump(in)).initCause(e); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | void write(ByteBuffer out) { |
| 274 | final int pos1 = out.position(); |