/** * Read from the supplied {@code InputStream} and deserialize the contents * into an object. * @see ObjectInputStream#readObject() */ @Override @SuppressWarnings("resource") public Object deserialize(InputStream inputStream) throws IOException { ObjectInputStream objectInputStream = new ConfigurableObjectInputStream(inputStream, this.classLoader); try { return objectInputStream.readObject(); } catch (ClassNotFoundException ex) { throw new NestedIOException("Failed to deserialize object type", ex); } }