So - I\'ve got a third party library that needs a File
as input. I\'ve got a byte array
.
I don\'t want to write the bytes to disk .. I\'d
There's one possibility, but it's a real long-shot.
If the API uses new FileReader(file)
or new FileInputStream(file)
then you're hosed, but...
If it converts the file to a URL or URI (using toURL()
or toURI()
) then, since File
is not final, you can pass in a subclass of File
in which you control the construction of the URL/URI and, more importantly, the handler.
But the chances are VERY slim!