/** Read an object from a stream (for objects that do not need a PlanetModel). * @param inputStream is the input stream. * @return the deserialized object. */ public static SerializableObject readObject(final InputStream inputStream) throws IOException { try { // read the class final Class<?> clazz = readClass(inputStream); return readObject(inputStream, clazz); } catch (ClassNotFoundException e) { throw new IOException("Can't find class for deserialization: "+e.getMessage(), e); } }
/** Read an object from a stream (for objects that need a PlanetModel). * @param planetModel is the planet model to use to deserialize the object. * @param inputStream is the input stream. * @return the deserialized object. */ public static SerializableObject readObject(final PlanetModel planetModel, final InputStream inputStream) throws IOException { try { // Read the class final Class<?> clazz = readClass(inputStream); return readObject(planetModel, inputStream, clazz); } catch (ClassNotFoundException e) { throw new IOException("Can't find class for deserialization: "+e.getMessage(), e); } }