code: public <T> OutputStream writeObject(T object, OutputStream outputStream) {
      writeObject(object, new OutputStreamBufferOutput(outputStream));
      return outputStream;
    }
docs: Writes an object to the given output stream.
  <p>
  The given object must have a {@link Serializer#register(Class) registered} serializer or implement {@link java.io.Serializable}.
  If a serializable type ID was provided during registration, the type ID will be written to the given
  {@link Buffer} in lieu of the class name. Types with no associated type ID will be written
  to the buffer with a full class name for reference during serialization.
  <p>
  Types that implement {@link CatalystSerializable} will be serialized via
  {@link CatalystSerializable#writeObject(BufferOutput, Serializer)} unless a
  {@link TypeSerializer} was explicitly registered for the type.
  <p>
  Types that implement {@link java.io.Serializable} will be serialized using Java's {@link java.io.ObjectOutputStream}.
  Types that implement {@link java.io.Externalizable} will be serialized via that interface's methods unless a custom
  {@link TypeSerializer} has been registered for the type. {@link java.io.Externalizable} types can,
  however, still take advantage of faster serialization of type IDs.
  
  @param object The object to write.
  @param outputStream The output stream to which to write the object.
  @param <T> The object type.
  @return The serialized object.
  @throws SerializationException If no serializer is registered for the object.
  @see Serializer#writeObject(Object)