Servlet writing a gzip

Discussion in 'Java' started by Peter Rank, Jun 18, 2004.

  1. Peter Rank

    Peter Rank Guest

    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
     
    Peter Rank, Jun 18, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    2,060
    Jack Jia
    Apr 4, 2004
  2. Java  script  Dude

    Add Browser Gate to GZip Servlet Filter

    Java script Dude, Jul 11, 2004, in forum: Java
    Replies:
    2
    Views:
    1,963
    Java script Dude
    Jul 12, 2004
  3. Java script Dude

    Add Browser Gate to GZip Servlet Filter

    Java script Dude, Jun 20, 2005, in forum: Java
    Replies:
    1
    Views:
    474
    shakah
    Jun 20, 2005
  4. Pawel
    Replies:
    2
    Views:
    991
    William Brogden
    Apr 12, 2006
  5. Petr Jakes
    Replies:
    6
    Views:
    344
    Dennis Lee Bieber
    Dec 19, 2006
Loading...

Share This Page