contentType = "image/png"
response.getOutputStream.write(myByteArray)
but is that the Scalatra way? Thanks.
If myByteArray is already in memory, that's a good option. If not,
these may be more efficient:
- If it's a File, return that from your action. You get zero-copy
from the default render pipeline.
- You can stream it to avoid materializing the whole PNG into memory:
org.scalatra.util.io.copy(pngStream,response.getOutputStream)
--
Ross A. Baker
ba...@alumni.indiana.edu
Indianapolis, IN, USA