CMLWriter won't close the underlying stream if a writer was provided.
This is because CMLWriter maintains an OutputStream and a Writer. The attached patch removes the Writer and adds conversion from Writer -> OutputStream. This isn't always desirable due to encodings so a warning message was added. A null check was also added to 'close()' method.
The CMLReader (which uses just an InputStream) throws an IllegalArgumentException if you try to use a Reader - this could also be done for CMLWriter but I think adding the conversion is more user friendly.