Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Develop a class BackupRestore that has two static methods: public static int backup(String filename, double partSize) public static int restore(String filename, int numberOfPieces) The backup

Develop a class BackupRestore that has two static methods:

public static int backup(String filename, double partSize)

public static int restore(String filename, int numberOfPieces)

The backup method backs up huge files by splitting them into smaller pieces that may fit into storage devices with different capacities (e.g., 700 mb for CD-Rs). The size of each piece is equal to partSize megabytes. The method creates the output files filename.1, filename.2, etc. and then returns an integer representing the number of files created.

The restore methods does the opposite. It combines filename.1, filename.2, etc. into filename. The method returns an integer representing the total size of the file filename.

In both methods, if an IOException occurs, display an error message and return -1. Use buffer classes to improve performance.

Try your code on the course syllabus (syllabus.pdf), i.e., split it into pieces of e.g. 0.25 MB size, delete the original file, and then combine your pieces back again and open the file to see if your code works.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bioinformatics Databases And Systems

Authors: Stanley I. Letovsky

1st Edition

1475784058, 978-1475784053

More Books

Students also viewed these Databases questions

Question

To define and understand the significance of power as a leader

Answered: 1 week ago

Question

What is digital literacy? Why is it necessary?

Answered: 1 week ago