It's of course not exactly what you are asking for. A stripped down
version would be that here:
Renderable renderable = new Renderable() {
@Override
public void render(Context context, Result result) {
ResponseStreams responseStreams = context.finalizeHeaders(result);
responseStreams.getOutputStream() // do what you want with the streams
}
};
return new Results.ok().render(renderable);
you can set the headers and everything else before calling "
context.finalizeHeaders(result);"