Servlet writing a gzip

P

Peter Rank

Hi all,

I try to write a Servlet that generates a gzip-Stream to write a
String that is represented by myDocumentString. This works fine until
the size of myDocumentString is not too large. Now I have a little bit
more than 1,300,000 characters in this String and the opening
ZIP-Programm doesn't show the file anymore. Is there a Bufferoverflow
or ssth. like that. No errormessage appears.
Here is my relevant code:

response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment;
filename=\"mydocument"".gz\"");
GZIPOutputStream zos = new
GZIPOutputStream(response.getOutputStream());
PrintWriter writer = new PrintWriter(new OutputStreamWriter(zos,
"UTF-8"));
writer.write(myDocumentString);
writer.flush();
writer.close();

Thanks in advance
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top