Question: Object Serialization and Deserialization In this assignment, you will create a class that you will need for the upcoming Super Ghost project. Please do your

Object Serialization and Deserialization In this assignment, you will create a class that you will need for the upcoming Super Ghost project. Please do your best job on this assignment as early as possible. You will depend on the code in this assignment in your final Super Ghost Project.

Create a class named MyIOManager that implements the accompanying interface IOManager. MyIOManager should adequately implement all methods in the IOManager such that it accepts and returns the defined parameters and throws the outlined exceptions correctly. When you submit your assignment to Grader Than only submit your MyIOManager.java file.

Please read the programmatic documentation of the IOManager interface to gain an understanding of what each function should do. This assignment will test your knowledge of serializing and deserializing a binary file, implementing interfaces, and throwing exceptions.

IOManager.java package homework;

import java.io.FileNotFoundException; import java.io.IOException;

public interface IOManager { /** * Sets the file path that this IOManager will read and write an object from. This * file location will be used by {@link #read()} and {@link #write(Object)} * @param path The file location to be read and written to * @throws FileNotFoundException when the specified path can not be found. * @throws IllegalArgumentException When the specified path points to a folder/directory rather than a file */ public void setPath(String path) throws FileNotFoundException, IllegalArgumentException; /** * The file path that is IOManager read and write an object from. This * file location will is used by {@link #read()} and {@link #write(Object)}. * This method may not return a null value. If the path is not set this should * return an empty string. * @param path The file location to be read and written to */ public String getPath(); /** * Reads the object saved in the file located at the path returned by {@link #getPath()} * @return An object saved in the file * @throws IOException When something goes wrong in the IO process * @throws ClassNotFoundException If the object located at the is a class that is not implemented * by this version of your software * @throws IllegalStateException If the file path has not been set yet */ public T read() throws IOException, ClassNotFoundException, IllegalStateException; /** * Writes and object to saved at the file located at the path returned by {@link #getPath()} * @param object The object saved in the file * @throws IOException When something goes wrong in the IO process * @throws IllegalStateException If the file path has not been set yet */ public void write(T object) throws IOException, IllegalStateException;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!