MDNSDiscover { private static byte[] discoverPacket(String serviceType) throws IOException { return queryPacket(serviceType, QCLASS_INTERNET | CLASS_FLAG_UNICAST, QTYPE_PTR); }  static void discover(String serviceType, Callback callback, int timeout); static Result resolve(String serviceName, int timeout);  }
@Test public void testDiscoverPacket() throws IOException { byte[] actual = queryPacket("_example._tcp.local", QCLASS_INTERNET | CLASS_FLAG_UNICAST, QTYPE_PTR); byte[] expected = new ByteBuilder() .hex("00 00 00 00 00 01 00 00 00 00 00 00") .hex("08").ascii("_example") .hex("04").ascii("_tcp") .hex("05").ascii("local") .hex("00 00 0c 80 01") .build(); assertArrayEquals(expected, actual); }