use of net.runelite.cache.definitions.TrackDefinition in project runelite by runelite.
the class TrackDumperTest method dumpTrackArchive.
private void dumpTrackArchive(File dumpDir, Storage storage, Archive archive) throws IOException {
byte[] contents = archive.decompress(storage.loadArchive(archive));
if (contents == null) {
return;
}
TrackLoader loader = new TrackLoader();
TrackDefinition def = loader.load(contents);
String name;
if (archive.getNameHash() != 0) {
name = djb2.getName(archive.getNameHash());
if (name == null) {
name = "name-" + archive.getNameHash();
}
} else {
name = "archive-" + archive.getArchiveId();
}
File dest = new File(dumpDir, name + ".midi");
assert !dest.exists();
Files.write(def.midi, dest);
}
use of net.runelite.cache.definitions.TrackDefinition in project runelite by runelite.
the class TrackLoader method load.
public TrackDefinition load(byte[] b) {
TrackDefinition def = new TrackDefinition();
load(def, new InputStream(b));
return def;
}
Aggregations