This is a straight up duplicate of #660, which was closed and I don't have permission to reopen.
I have a use case where the accepted solution of using a mutable reference doesn't work. I would like to store the partially written data inside the Writer as a std::io::Cursor<Vec<u8>>, so I can keep the Writer around without dealing with lifetimes or file handles, but since there's no way to access the inner writer at all this isn't currently possible.
My suggestion would be for Writer::finish to simply return the writer, but a getter would also work.