In the previous post I showed how you can post binary data to a jersey REST api. You can also use Jersey to serve files, although its better done by apache or nginx but sometimes you might want to serve thumbnails stored in a database out of a service and put varnish in front of the REST api to cache the thumbnails. This is just a demonstration of using jersey to serve binary data in streaming fashion. @Path("/download-service") public class DownaloadService extends SecureRestService { private static final AppLogger logger = AppLogger.getLogger(DownaloadService.class); @POST @Produces(MediaType.APPLICATION_OCTET_STREAM) public StreamingOutput getThumbnail( @FormParam("securityKey") final String securityKey, @FormParam("guid") final String guid) throws JSONException { return new StreamingOutput() { @Override public void write(OutputStream out) throws IOException { try { if (!isAuthorized(securityKey)) { response.sendErro...