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));
      }
    }
docs: 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>.