/** * Creates an <code>InputArchive</code> that reads from the provided * <code>InputStream</code>. * @param stream The <code>InputStream</code> to be read from. * @return The new <code>InputArchive</code>. * @throws IOException If an <code>ObjectInputStream</code> could not be * instantiated for the provided <code>InputStream</code>. */ public static InputArchive fromInputStream(InputStream stream) throws IOException { if (stream instanceof ObjectInput) { return new InputArchive((ObjectInput) stream); } else { return new InputArchive(new ObjectInputStream(stream)); } }
@Override public void restoreState(ObjectInput input) throws Exception { archiveState(new InputArchive(input)); }