public byte[] getFile (int oid) throws IOException {
        if (oid == lastId) return lastFile;

        if (oid < 1) // invalid, apparently. or bytecode - lookie no touchie
            return null;

        int id = -1;
        for (int i = 0; i < ids.length; i++)
            if (ids[i] == oid) {
                id = i;
                break;
            }
        if (id == -1) return null;

        source.seek(offsets[id]);
        int a = source.read();
        // id of resource. 0 means deleted
        if (a < 1) return null;

        int ttype = source.readInt(); // we don't need this?
        int len = source.readInt();

        // we found the data - release cache
        lastFile = null;
        lastId = -1;

        byte[] ffile;
        try {
            ffile = new byte[len];
            source.readFully(ffile);
        } catch (OutOfMemoryError e) {
            return null;
        }

        if (len < CACHE_LIMIT) {
            lastId = oid;
            lastFile = ffile;
        }
        return ffile;
    }
Return data of the specified data file.
main/src/main/java/cgeo/geocaching/wherigo/openwig/formats/CartridgeFile.java