refactor: extract method from doc_flush_binaries. add with_stream/2 to handle automatically opening and closing binary streams.
refactor: extract method from doc_flush_binaries. add with_stream/2 to handle automatically opening and closing binary streams.


git-svn-id: cddd53339f8fd45d5e26e8b408ccee250f6290a7@764257 13f79535-47bb-0310-9956-ffa450edef68

benoitc/couchdb-old,benoitc/couchdb-old,benoitc/couchdb-old,benoitc/couchdb-old,benoitc/couchdb-old