/**
* Returns an ServletOutputStream that writes into the OutputStream provided by the CacheItem. All output is redirected so nothing will be sent to the client.
* @throws IllegalStateException If getWriter() has been called before
* @throws IOException
*/
public ServletOutputStream getOutputStream() throws IOException {
if (writer != null) {
throw new IllegalStateException();
}
if (outputStream == null) {
outputStream=new DelegatingServletOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
}
return outputStream;
}

Example 95

From project rolefen, under directory /dependency/apache-tomcat-6.0.26/webapps/examples/WEB-INF/classes/compressionFilters/.