Accept Stream objects instead of only file names.

This seems to be the only sane implementation of stream buffering and I need to buffer writes between code which ends up writing a file but only provides me a writable stream so I would like to be able to wrap a steam.