Write the headers and content of the MIME object to stream.
stream
a Object
a FormatOptions or null
the number of bytes written or %-1 on fail.