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); }
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); }
int recordLength = di.readInt(); int subblocks = di.readInt(); int songId = di.readInt(); long blockType = di.readInt(); di.skipBytes(8); int modificationDate = di.readInt(); track.setDateModified(Dates.fromMac(modificationDate)); int fileSize = di.readInt(); track.setSize(fileSize); int playtimeMillis = di.readInt(); track.setTotalTime(playtimeMillis); di.skipBytes(10); int year = di.readShort(); track.setYear(year); di.skipBytes(2); track.setBitRate(di.readShort()); track.setSampleRate(di.readShort()); int x = di.readShort();
InputRange thisChunk = new InputRange(di.getPosition()); String type = Util.toString(di.readInt()); consumed += 4; int length = di.readInt(); consumed += 4; recLength = di.readInt(); consumed += 4; int hohmType = di.readInt(); consumed += 4; di.readInt(); // Index? expectZeroBytes(di, 4); consumed += 8; 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)
InputRange thisChunk = new InputRange(di.getPosition()); String type = Util.toString(di.readInt()); consumed += 4; int length = di.readInt(); consumed += 4; recLength = di.readInt(); consumed += 4; int hohmType = di.readInt(); consumed += 4; case 0x69: case 0x6c: di.skipBytes(recLength - consumed); consumed = recLength; thisChunk.more = hohmType + " [ignored] "; if (endCurrentPlaylist(foundPlaylist)) return currentPlaylistItems; di.skipBytes(recLength - consumed); consumed = recLength; thisChunk.more = hohmType + " [ignored] "; di.skipBytes(length - consumed); consumed = length; if (endCurrentPlaylist(foundPlaylist))
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 hexDumpBytes(Input di, int count) throws IOException { for (int i = 0; i < count; i++) { int v = di.readUnsignedByte(); // System.out.printf("%3d 0x%02x %4s\n", i, v, (v == 0 ? ' ' : (char) v)); } }
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); }
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); } } }
public static Hdfm read(Input di, long fileLength) throws IOException, ItlException int hdr = di.readInt(); assertEquals("hdfm", Util.toString(hdr)); int hl = di.readInt(); int fl = di.readInt(); if (fileLength != fl) int unknown = di.readInt(); int vsl = di.readUnsignedByte(); byte[] avs = new byte[vsl]; di.readFully(avs); di.readFully(headerRemainder); di.readFully(restOfFile);
di.skipBytes(23 * 4); length -= 23 * 4; int len = di.readInt(); String type = Util.toString(di.readInt()); len -= 8; Util.assertEquals("url ", type); di.skipBytes(12); len -= 12; di.readFully(ba); di.skipBytes(15 * 4); len = di.readInt(); type = Util.toString(di.readInt()); len -= 8; di.skipBytes(12); len -= 12; di.readFully(ba); link = toString(ba); len = di.readInt(); type = Util.toString(di.readInt()); len -= 8;