尝试使用https://github.com/googleapis/google-cloud-java/blob/master/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageImpl.java#L139进行Java互操作 - 使用字节数组的
在我的REPL中有以下内容:
(还有其他的,但这似乎是最相关的。)
另外:
但是当我调用
如果我尝试将
我是否漏掉了什么明显的东西?谢谢!
编辑:如何在Clojure中处理Java可变长度参数?非常相似,并且更通用(这很好)。 这个问题最终成为关于一个特定的
create
方法。在我的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} | [com.google.cloud.storage.BlobInfo byte<> com.google.cloud.storage.Storage$BlobTargetOption<>] |
(还有其他的,但这似乎是最相关的。)
另外:
user=> s
#object[com.google.cloud.storage.StorageImpl 0x57fb59c8 "com.google.cloud.storage.StorageImpl@57fb59c8"]
user=> blob-info
#object[com.google.cloud.storage.BlobInfo$BuilderImpl 0x1e8ce729 "com.google.cloud.storage.BlobInfo$BuilderImpl@1e8ce729"]
user=> b
#whidbey/bin "SEVZIE1ZIEdVWQ==“
但是当我调用
.create
时,我得到:user=> (.create s blob-info (bytes b))
java.lang.IllegalArgumentException: No matching method create found taking 2 args for class com.google.cloud.storage.StorageImpl
如果我尝试将
nil
作为第三个参数添加,我会得到与3 args
相同的错误。我是否漏掉了什么明显的东西?谢谢!
编辑:如何在Clojure中处理Java可变长度参数?非常相似,并且更通用(这很好)。 这个问题最终成为关于一个特定的
create
函数签名的具体问题。