static byte[] readPersistentId(Input di) throws IOException { byte[] id = new byte[8]; di.readFully(id); if (!Arrays.equals(id, BLANK_ID)) { return id; } else { return null; } } }
static void expectZeroBytes(Input di, int count, String where) throws IOException, ItlException { byte[] ba = new byte[count]; di.readFully(ba); for (int i = 0; i < ba.length; i++) { byte b = ba[i]; if (b != 0x00) { throw new ItlException("Expected " + count + " zero bytes" + where + ". Was: 0x" + Integer.toHexString(b) + " at offset " + i); } } }
private void readHpim(Input di, int length) throws IOException, ItlException { int unknownA = di.readInt(); int unknownB = di.readInt(); int itemCount = di.readInt(); // System.out.println("HPIM items: " + itemCount); // System.out.printf("0x%04x%04x\n", unknownA, unknownB); byte[] remaining = new byte[length - 20]; di.readFully(remaining); byte[] ppid = new byte[8]; System.arraycopy(remaining, 420, ppid, 0, ppid.length); currentPlaylist = new Playlist(); currentPlaylist.ppid = ppid; playlists.add(currentPlaylist); }
private void readHpim(Input di, int length) throws IOException, ItlException { int unknownA = di.readInt(); int unknownB = di.readInt(); int itemCount = di.readInt(); // System.out.println("HPIM items: " + itemCount); // System.out.printf("0x%04x%04x", unknownA, unknownB); // System.out.println(""); byte[] remaining = new byte[length - 20]; di.readFully(remaining); byte[] ppid = new byte[8]; System.arraycopy(remaining, 420, ppid, 0, ppid.length); currentPlaylistItems = new PlaylistRawItems(itemCount); }
di.readFully(ba);
private void readHptm(Input di, int length) throws IOException, ItlException { byte[] unknown = new byte[16]; di.readFully(unknown); int key = di.readInt(); // System.out.println(" Key: " + key); if (currentPlaylist == null) { throw new ItlException("Playlist item outside playlist content"); } currentPlaylist.addItem(key); di.skipBytes(length - 28); }
di.readFully(ba); System.out.println(new String(ba));
di.readFully(ba); consumed += 8; byte[] xmlBa = new byte[recLength - consumed]; di.readFully(xmlBa); String plist = new String(xmlBa); consumed = recLength; di.readFully(smartCriteria); if (currentPlaylist.smartCriteria != null) di.readFully(smartInfo); if (currentPlaylist.smartInfo != null) di.readFully(pcInf); di.readFully(unknownHohmContents); throw new UnknownHohmException(hohmType, unknownHohmContents); di.readFully(footerBytes);