@Test public void testDecodeRandomPackets() { final int SEED = 0x5FC45975; final int NUM_PACKETS = 10000; final int MAX_PACKET_LENGTH = 1536; Random random = new Random(SEED); for (int i = 0; i < NUM_PACKETS; i++) { int packetLength = random.nextInt(MAX_PACKET_LENGTH+1); byte[] packet = new byte[packetLength]; random.nextBytes(packet); try { decode(packet, packetLength); fail("decoding a random packet did not throw IOException"); } catch (IOException e) { } } }
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);  }