private FileSystem() throws IOException {
        if (image.createNewFile()) {
            byte[] rootBytes = Descriptor.getRoot().toBytes();
            FileOutputStream fos = new FileOutputStream(image);
            fos.write(rootBytes);
            fos.write(new byte[blockOffset - Descriptor.size]);
            fos.close();
        }
        FileInputStream fis = new FileInputStream(image);
        byte[] descTableBytes = new byte[blockOffset];
        if (fis.read(descTableBytes) == -1) {
            System.err.println("Error: missing data in descriptors table!");
        }
        fis.close();
        ByteBuffer tableBuffer = ByteBuffer.wrap(descTableBytes);
        byte[] descBytes = new byte[Descriptor.size];
        for (int i = 0, l = blockOffset / Descriptor.size; i < l; i++) {
            tableBuffer.get(descBytes);
            Descriptor descriptor = Descriptor.fromBytes(descBytes);
            if (descriptor.getId() > Descriptor.ROOT_ID || i == 0) {
                descriptorTable[i] = descriptor;
            }
            else {
                missingIds.add(i);
            }
        }
        currentDir = descriptorTable[Descriptor.ROOT_ID];
        storage = new RandomAccessFile(image, "rw");
    }