public Disk(int size) {
        File diskName = new File("DISK");
        if (diskName.exists()) {
            if (diskName.length() != size * BLOCK_SIZE) {
                throw new DiskException(
                    "File DISK exists but is the wrong size");
            }
        }
        this.DISK_SIZE = size;
        if (size < 1) {
            throw new DiskException("A disk must have at least one block!");
        }
        // NOTE:  the "new" operator always clears the result object to nulls
        data = new byte[DISK_SIZE * BLOCK_SIZE];
        int count = BLOCK_SIZE;
        try {
            FileInputStream is = new FileInputStream("DISK");
            is.read(data);
            out.printf("Restored %d bytes from file DISK\n", count);
            is.close();
            return;
        } catch (FileNotFoundException e) {
            out.println("Creating new disk");
        } catch (Exception e) {
            e.printStackTrace();
            exit(1);
        }
        byte[] junk = new byte[BLOCK_SIZE];
        for (int i = 0; i < BLOCK_SIZE; ) {
            junk[i++] = 74;
            junk[i++] = 85;
            junk[i++] = 78;
            junk[i++] = 75;
        }
        for (int i = 1; i < DISK_SIZE; i++) {
            arraycopy(
                junk, 0,
                data, i * BLOCK_SIZE,
                BLOCK_SIZE);
        }
    } // Disk(int)