Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow Faces.sendFile() to take some sort of OutputStreamCallback #194
It would be nice if there was a
I am asking for this because some processes are naturally easier to use with
I used a lambda here for brevity but I don't mind using an anonymous class that only throws IOException if that is OK for you.
As this method would not be in charge of writing on the output stream anymore, the (optional) content-length will have to be calculated by wrapping the response output stream in some sort of CountingByteOutputStream.
I came across the need for such a method one more time as I was generating PDFs with FOP.
Single-method interfaces like OmniFaces Callback can just directly be used as lambdas in Java8, even without
I'll add one for output. I'll skip content length as that would require an uncommitted response (and thus the entire output in server's memory). User can always opt for temp file approach instead and then passing via existing methods.