Java examples for File Path IO:GZIP
Return gzipping PrintWriter for HttpServletResponse
import java.io.IOException; import java.io.PrintWriter; import java.util.zip.GZIPOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class Main{ /** Return gzipping PrintWriter for response */ public static PrintWriter getGzipWriter(HttpServletResponse response) throws IOException { return (new PrintWriter(new GZIPOutputStream( response.getOutputStream()))); }/*from w w w .ja v a 2s . c o m*/ }