Read file as stream, set response and close stream does not work


In a REST API, I have created a Java service to read file as InputStream. I set InputStream as output variable of Java service.
Now I map InputStream to responseStream of pub.flow:setResponse2.
After this I use to close the InputStream.

When I call this REST API from browser I get stream closed error. Even though I am closing the stream after calling setResponse2.
Removing works fine but it leaves the file locked.


Hi Kalpshekhar,
in Java, nothing will be read from the open stream unless you tell Java to do so. You will find plenty of information regarding this topic in the Internet (e.g.

Best regards,