/** * Parse a byte array and rebuild the dns question from it. * @param dis The input stream. * @param data The plain data (for dns name references). * @return The parsed dns question. * @throws IOException On errors (read outside of packet). */ public static Question parse(DataInputStream dis, byte[] data) throws IOException { String name = NameUtil.parse(dis, data); TYPE type = TYPE.getType(dis.readUnsignedShort()); CLASS clazz = CLASS.getClass(dis.readUnsignedShort()); return new Question (name, type, clazz); }
this.type = TYPE.getType(dis.readUnsignedShort()); int clazzValue = dis.readUnsignedShort(); this.clazz = CLASS.getClass(clazzValue & 0x7fff); this.unicastQuery = (clazzValue & 0x8000) > 0; if (this.clazz == null) {