Fork me on GitHub

Trying to do some java interop with - the create method with a byte array. I have in my repl:

user=> (->> s r/reflect :members 
			   (filter #(instance? clojure.reflect.Method %)) 
			   (filter #(:public (:flags %))) 
			   (filter #(= (str (:name %)) "create")) 
			   (print-table [:name :flags :parameter-types]))

|  :name |              :flags |                                                                                           :parameter-types |
| create | #{:varargs :public} |             [ byte<>$BlobTargetOption<>] |
(There are others, but this appears the most relevant.) Also:
user=> s
#object[ 0x57fb59c8 "[email protected]"]
user=> blob-info
#object[$BuilderImpl 0x1e8ce729 "[email protected]"]
user=> b
#whidbey/bin "SEVZIE1ZIEdVWQ=="
But when I go to call .create, I get:
user=> (.create s blob-info (bytes b))

java.lang.IllegalArgumentException: No matching method create found taking 2 args for class
If I try to add nil as the 3rd argument, I get the same error with 3 args. Am I missing something obvious here?


It's variadic. In Java that means it takes an array of the type.