Open gciatto opened 3 years ago
As of JPype 1.3 it is not possible.
It is technically possible but the Python to Java bridge would need to be used to make it easy. Because then Java InputStream can be directly implemented in Java.
There is another way to achieve the result without the reverse bridge, but it would require another support class in org.jpype. It would require an interface in Java which provides services that Python can use JProxy to implement. The wrapper can then forward to InputStream requests to IOBase. Thus it requires 3 pieces. It would be a 2 to 4 hour task.
Maybe I see your point. In the next days, I'll try to implement the second solution without affecting org.jpype (i.e. with some external jar). Maybe you could then integrate that in org.jpype?
Sure that would be a great PR. It shouldn't be too difficult. You just need to
Any update with this ?
... or
TextIOBase
intoReader
?It would be very nice to open a file with
open()
and pass the returned IOBase to a Java method accepting anInputStream
or aReader