@Test public void testReplyPacket() throws IOException { byte[] packet = createReplyPacket(); Result r = decode(packet, packet.length); assertEquals("192.168.1.100", r.a.ipaddr); assertEquals("dev0123456789.local", r.a.fqdn); assertEquals(10, r.a.ttl); assertEquals(0, r.srv.priority); assertEquals(0, r.srv.weight); assertEquals(1234, r.srv.port); assertEquals("dev0123456789.local", r.srv.target); assertEquals("device-1234._example._tcp.local", r.srv.fqdn); assertEquals(10, r.srv.ttl); Map<String, String> expectedTxt = new HashMap<>(); expectedTxt.put("foo", "bar"); expectedTxt.put("bar", null); expectedTxt.put("txtvers", "1"); assertEquals(expectedTxt, r.txt.dict); assertEquals("device-1234._example._tcp.local", r.txt.fqdn); assertEquals(10, r.txt.ttl); }
static Result decode(byte[] packet, int packetLength) throws IOException { Result result = new Result(); decode(packet, packetLength, result); return result; }
MDNSDiscover { static Result decode(byte[] packet, int packetLength) throws IOException { Result result = new Result(); decode(packet, packetLength, result); return result; } }
MDNSDiscover { static Result decode(byte[] packet, int packetLength) throws IOException { Result result = new Result(); decode(packet, packetLength, result); return result; }  }
MDNSDiscover { static Result decode(byte[] packet, int packetLength) throws IOException { Result result = new Result(); decode(packet, packetLength, result); return result; }  static void discover(String serviceType, Callback callback, int timeout); static Result resolve(String serviceName, int timeout); }
MDNSDiscover { static Result decode(byte[] packet, int packetLength) throws IOException { Result result = new Result(); decode(packet, packetLength, result); return result; }  static void discover(String serviceType, Callback callback, int timeout); static Result resolve(String serviceName, int timeout);  }