Package java.util.zip

Examples of java.util.zip.GZIPOutputStream.finish()


  if (buf.length > 256) {
      byte[] b = null;
      ByteArrayOutputStream bos = new ByteArrayOutputStream();
      GZIPOutputStream gzip = new GZIPOutputStream(bos);
      gzip.write(buf);
      gzip.finish();
      gzip.close();
      b = bos.toByteArray();
      bos.close();

      if ( buf.length/b.length>2) {
View Full Code Here


    {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        GZIPOutputStream gzip = new GZIPOutputStream(bos);
//        long size=this.ramoutput.getFilePointer();
        this.ramoutput.writeTo(gzip);     
        gzip.finish();
        gzip.close();
        byte[] b = bos.toByteArray();
        bos.close();
        this.output.writeVInt(b.length);
        this.output.writeBytes(b, 0,b.length);
View Full Code Here

      try {
         GZIPOutputStream stream = (GZIPOutputStream) rewrite.getRequest().getAttribute(STREAM_KEY);
         if (stream != null)
         {
            stream.flush();
            stream.finish();
         }
      }
      catch (IOException e) {
         throw new RewriteException("Could not finish GZip Encoding", e);
      }
View Full Code Here

        read += x;
        if(cos.written() > maxWriteLength)
          throw new CompressionOutputSizeException();
      }
      gos.flush();
      gos.finish();
      cos.flush();
      gos = null;
      if(cos.written() > maxWriteLength)
        throw new CompressionOutputSizeException();
      return cos.written();
View Full Code Here

        throw new CompressionOutputSizeException();
      return cos.written();
    } finally {
      if(gos != null) {
        gos.flush();
        gos.finish();
      }
    }
  }

  @Override
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try
        {
            GZIPOutputStream gzip = new GZIPOutputStream(baos);
            gzip.write(bytes, 0, bytes.length);
            gzip.finish();
            byte[] fewerBytes = baos.toByteArray();
            gzip.close();
            baos.close();
            gzip = null;
            baos = null;
View Full Code Here

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        try
        {
            GZIPOutputStream gzip = new GZIPOutputStream(baos);
            gzip.write(bytes, 0, bytes.length);
            gzip.finish();
            byte[] fewerBytes = baos.toByteArray();
            gzip.close();
            baos.close();
            gzip = null;
            baos = null;
View Full Code Here

      else
      {
         super.write(dataObject, oos, version);
      }

      gzos.finish();
      oos.flush();
   }

   /**
    * Returns a <code>CompressingMarshaller</code>.
View Full Code Here

                + "JOB[14-200904160239--example-forkjoinwf] ACTION[-] [org.apache.oozie.core."
                + "command.WorkflowRunnerCallable] " + "released lock");
        String strg = sb.toString();
        byte[] buf = strg.getBytes();
        gzout.write(buf, 0, buf.length);
        gzout.finish();
        gzout.close();

        // oozie.log.gz GZip file would always be included in list of files for log retrieval
        outFilename = "oozie.log.gz";
        f = new File(getTestCaseDir() + "/" + outFilename);
View Full Code Here

                + "JOB[14-200904160239--example-forkjoinwf] ACTION[-] [org.apache.oozie.core."
                + "command.WorkflowRunnerCallable] " + "released lock");
        strg = sb.toString();
        buf = strg.getBytes();
        gzout.write(buf, 0, buf.length);
        gzout.finish();
        gzout.close();

        // Test to check if an invalid GZip file(file name not in the expected format oozie.log-YYYY-MM-DD-HH.gz) is
        // excluded from log retrieval
        outFilename = "oozie.log-2011-12-03-15.bz2.gz";
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.