A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
GZIP Utility
Sagar Sharma
Ranch Hand
Joined: Aug 31, 2000
Posts: 92
posted
Jan 17, 2001 02:39:00
0
Do i need to code extra except setting of the Accept-Encoding Header to send HTML files in a GZIP format??
thanks in advance
sagar
Bob Moranski
Ranch Hand
Joined: Nov 22, 2000
Posts: 177
posted
Jan 17, 2001 13:43:00
0
You also need
GZIPOutputStream
. You can get it by
OutputStream
out = new
GZIPOutputStream
(res.getOutputStream());
Then you can send it with ServletUtils class in Oreilly's
servlet
com package from
www.servlets.com.
try{
ServletUtils.returnFile(file, out);
//file being the path to the specified file
}
catch(
FileNotFoundException
e){
throw new
ServletException
("No such file");
}
catch(
IOException
e){
throw new
ServletException
("Problem sending file...");
}
I agree. Here's the link:
http://aspose.com/file-tools
subject: GZIP Utility
Similar Threads
how can I deacrease volume of my html pages?
Which are the different between GZIPInputStream to ZipInputStream?
JSP page with js file compression
java.io.IOException: Corrupt GZIP trailer
Size of Compressed Data?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter