Hi all,
maybe I’m overthinking things but I used to learn whenever I have a resoruce Input/Output I’ll do a try-finllay block to close the resource at the end.
In this case I try to display a PDF from a byte array.
For this I create a StreamResource:
StreamResource pdfResource = new StreamResource(
() -> new ByteArrayInputStream(pdfContent),
filename
);
I now wonder where and how to close the InputStream. I don’t want to have a blocked Resource in the Memmory of the server.
Do I have to do this manualy or does the Vaadin-Framework close the given Resources once the ConnectorResource/StreamResouce is not used anymore.
I found following Documentation but that isn’t really clear on the process:
https://dev.vaadin.com/wiki/Vaadin7/Features/ConnectorResource
Thanks for any advice