### Question:
HohmPodcast { public static HohmPodcast parse(Input di, int length) throws IOException { String url, link, aurl; di.skipBytes(23 * 4); length -= 23 * 4; if (length <= 0) { return null; } int len = di.readInt(); String type = Util.toString(di.readInt()); len -= 8; Util.assertEquals("url ", type); di.skipBytes(12); len -= 12; byte[] ba; ba = new byte[len]; di.readFully(ba); url = toString(ba); di.skipBytes(15 * 4); len = di.readInt(); type = Util.toString(di.readInt()); len -= 8; Util.assertEquals("link", type); di.skipBytes(12); len -= 12; ba = new byte[len]; di.readFully(ba); link = toString(ba); len = di.readInt(); type = Util.toString(di.readInt()); len -= 8; while(!"aurl".equals(type)) { System.out.println(type); if(type.equals("pech")) { System.out.println("Recurse"); dump(di, len); } else { ba = new byte[len]; di.readFully(ba); System.out.println(new String(ba)); } len = di.readInt(); type = Util.toString(di.readInt()); len -= 8; } Util.assertEquals("aurl", type); di.skipBytes(12); len -= 12; ba = new byte[len]; di.readFully(ba); aurl = toString(ba); return new HohmPodcast(url, link, aurl); } HohmPodcast(String url, String link, String aurl); static String toString(byte[] ba); static HohmPodcast parse(Input di, int length); final String url; final String link; final String aurl; }### Answer:
@Test public void parseEmptySample() throws IOException { HohmPodcast hp = HohmPodcast.parse( new InputImpl(new ByteArrayInputStream(emptySample)), emptySample.length); assertNull(hp); }
@Test public void parseSinglePodcast() throws IOException { HohmPodcast hp = HohmPodcast.parse( new InputImpl(new ByteArrayInputStream(sample)), sample.length); assertEquals("http: assertEquals("http: assertEquals("http: }