code: public void write( Object object,
                         OutputStream stream ) throws IOException {
          BsonDataOutput buffer = new BsonDataOutput();
          write(null, object, buffer);
          buffer.writeTo(stream);
      }
docs: Write the supplied in-memory {@link Document} in standard BSON binary format to the supplied stream.
  
  @param object the BSON object or BSON value; may not be null
  @param stream the output stream; may not be null
  @throws IOException if there was a problem reading from the stream