cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thelizardreborn <>
Subject FileInputStream/GZIPOutputStream in flow
Date Mon, 21 Jul 2008 20:38:55 GMT

I am having a problem writing a gzip file from my flowscript. My basic goal
is to use flow to gzip existing html documents. The gzip file is being
created, but is empty (the source file is definitely not empty). Here is the
relevant part of the code I am using:

    try {
      var sep =;
      // Create the GZIP output stream
      var outFilename = "path"+sep+"to"+sep+"file"+sep+"filename.gzip";
//absolute file path
      var out = new;

      // Open the input file
      var inFilename = "path"+sep+"to"+sep+"file"+sep+"filename.html";
//absolute file path
      var lineIn = new;

      // Transfer bytes from the input file to the GZIP output stream
      /* --Original Code Sample: 
       * --(ByteArrayOutputStream used instead to get through the
javascript-ness of flowscript types)
       * var buf = new byte[1024];
      var myByteArray = new;
      var buf = myByteArray.toByteArray();
      var len;
      while ((len = > 0) {
        out.write(buf, 0, len);

      // Complete the GZIP file
    } catch (e) {

At this point, when I run the code, no errors appear in any of the logs. Any
ideas what I'm doing wrong? 
View this message in context:
Sent from the Cocoon - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message