我正在调用一个接受的方法InputStream
。这是github上的方法:https ://github.com/drewnoakes/metadata-extractor/blob/2.8.0/Source/com/drew/imaging/ImageMetadataReader.java#L89
我正在调用BufferedInputStream
应该可以使用的方法,因为它是一个子对象,InputStream
但我不断收到此错误:
No signature of method: static com.drew.imaging.ImageMetadataReader.readMetadata() is applicable for argument types: (java.io.BufferedInputStream) values: [java.io.BufferedInputStream@74d4ec5f]
Possible solutions: readMetadata(java.io.File), readMetadata(java.io.BufferedInputStream, boolean). Stacktrace follows:
Message: No signature of method: static com.drew.imaging.ImageMetadataReader.readMetadata() is applicable for argument types: (java.io.BufferedInputStream) values: [java.io.BufferedInputStream@74d4ec5f]
Possible solutions: readMetadata(java.io.File), readMetadata(java.io.BufferedInputStream, boolean)
Line | Method
->> 137 | settings in com.foo.scanner.AdminController
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 198 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 59 | doFilter in grails.plugin.springsecurity.web.SecurityRequestHolderFilter
这是我的代码:
println file62.name //prints name of the file
println file62.inputStream.getClass() //prints java.io.BufferedInputStream
InputStream is = (InputStream)file62.inputStream
Metadata metadata = com.drew.imaging.ImageMetadataReader.readMetadata(is) //readMetadata expects InputStream
我拥有的库版本:
✗ grails dependency-report | grep "drew"
+--- com.drewnoakes:metadata-extractor:2.9.1
+--- com.drewnoakes:metadata-extractor:2.9.1
+--- com.drewnoakes:metadata-extractor:2.9.1
这是 2.9.1 中的方法:https ://github.com/drewnoakes/metadata-extractor/blob/2.9.1/Source/com/drew/imaging/ImageMetadataReader.java#L88