docs: public byte[] write( Object object ) throws IOException {
          BsonDataOutput buffer = new BsonDataOutput();
          write(null, object, buffer);
          ByteArrayOutputStream stream = new ByteArrayOutputStream(buffer.size());
          buffer.writeTo(stream);
          return stream.toByteArray();
      }