Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 3

blur-text-image

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

Advances In Spatial Databases 2nd Symposium Ssd 91 Zurich Switzerland August 1991 Proceedings Lncs 525

Authors: Oliver Gunther ,Hans-Jorg Schek

1st Edition

3540544143, 978-3540544142

More Books

Students also viewed these Databases questions