public WiiIsoFilesystem(FileBase _file) throws IOException
    {
        if (masterkey == null)
        {
            try
            {
                FileBase keyfile = new ExternalFile("key.bin", "r");
                masterkey = keyfile.getContents();
                keyfile.close();
            }
            catch (IOException ex)
            {
                throw new IOException("WiiIsoFilesystem: Failed to load the key: "+ex.getMessage());
            }
        }
        
        blockCache = new HashMap<>(32);
        
        file = _file;
        file.setBigEndian(true);
        
        file.position(0x18);
        int tag = file.readInt();
        if (tag != 0x5D1C9EA3)
            throw new IOException(String.format("!File isn't a Wii ISO (tag 0x%1$08X, expected 0x5D1C9EA3)", tag));
        
        for (int p = 0; p < 4; p++)
        {
            file.position(0x40000 + p*8);
            int numparts = file.readInt();
            long partsoffset = (long)file.readInt() << 2;
            readPartitionTable(partsoffset, numparts, p);
        }
    }