I'm trying to dump models from an 861 cache and I'm getting this error:
Code:
Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exce
eds VM limit
at com.alex.store.ReferenceTable.decodeHeader(ReferenceTable.java:192)
at com.alex.store.ReferenceTable.<init>(ReferenceTable.java:26)
at com.alex.store.Index.<init>(Index.java:28)
at com.alex.store.Store.<init>(Store.java:38)
at com.alex.store.Store.<init>(Store.java:27)
at com.rs.tools.ModelDumper.main(ModelDumper.java:14)
Here's the model dumper script I'm using:
Code:
package com.rs.tools;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import com.alex.store.Index;
import com.alex.store.Store;
import com.rs.cache.Cache;
public class ModelDumper {
public static void main(String[] args) throws IOException {
Cache.STORE = new Store(
"C:/Users/4545/Desktop/data861/",
false);
Index index = Cache.STORE.getIndexes()[7];
System.out.println(index.getLastArchiveId());
for (int i = 0; i < index.getLastArchiveId(); i++) {
byte[] data = index.getFile(i);
if (data == null)
continue;
// if(!(data[data.length + -1] == -1 && data[-2 + data.length] ==
// -1))
// if((data[-1 + data.length] ^ 0xffffffff) != 0 || data[-2 +
// data.length] != -1)
// System.out.println(i);
writeFile(data, "C:/Users/4545/Desktop/861models/" + i + ".dat");
}
}
public static void writeFile(byte[] data, String fileName) throws IOException {
OutputStream out = new FileOutputStream(fileName);
out.write(data);
out.close();
}
}
Any help would be greatly appreciated, I tried searching for another model dumper but the two threads I found had broken links.
Edit: Thought I might add that dumping models from the OSRS cache works