/** * Creates a new <code>OutputArchive</code> that writes to the specified * <code>OutputStream</code>. * @param stream The <code>OutputStream</code> to be written to. * @return The new <code>OutputArchive</code>. * @throws IOException If unable to instantiate an * <code>ObjectOutputStream</code> for the provided * <code>OutputStream</code>. */ public static OutputArchive fromOutputStream(OutputStream stream) throws IOException { if (stream instanceof ObjectOutput) { return new OutputArchive((ObjectOutput) stream); } else { return new OutputArchive(new ObjectOutputStream(stream)); } }
@Override public void saveState(ObjectOutput output) throws Exception { archiveState(new OutputArchive(output)); }