Examples of GZIPOutputStream


Examples of com.jcraft.jzlib.GZIPOutputStream

    private IRubyObject initializeCommon(IRubyObject stream, int level) {
        realIo = (RubyObject) stream;
        try {
            // the 15+16 here is copied from a Deflater default constructor
            Deflater deflater = new Deflater(level, 15+16, false);
            io = new GZIPOutputStream(new IOOutputStream(realIo, false, false), deflater, 512, false);
            return this;
        } catch (IOException ioe) {
            throw getRuntime().newIOErrorFromException(ioe);
        }
    }
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

    if (objectOutputFileName.length() != 0) {
      OutputStream os = new FileOutputStream(objectOutputFileName);
      // binary
      if (!(objectOutputFileName.endsWith(".xml") || (objectOutputFileName.endsWith(".koml") && KOML.isPresent()))) {
        if (objectOutputFileName.endsWith(".gz")) {
          os = new GZIPOutputStream(os);
        }
        ObjectOutputStream objectOutputStream = new ObjectOutputStream(os);
        objectOutputStream.writeObject(classifier);
        if (template != null) {
          objectOutputStream.writeObject(template);
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

      m_Log.statusMessage("Saving model to file...");
     
      try {
  OutputStream os = new FileOutputStream(sFile);
  if (sFile.getName().endsWith(".gz")) {
    os = new GZIPOutputStream(os);
  }
  ObjectOutputStream objectOutputStream = new ObjectOutputStream(os);
  objectOutputStream.writeObject(clusterer);
  if (trainHeader != null) objectOutputStream.writeObject(trainHeader);
  if (ignoredAtts != null) objectOutputStream.writeObject(ignoredAtts);
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

            while (it.hasNext()) {
                try {
                    file = (File) it.next();
                    File zipped = new File(file.getAbsolutePath() + ".gz");
                    GZIPOutputStream zip = new GZIPOutputStream(new FileOutputStream(zipped));
                    BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
                    byte[] b = new byte[BUFFER_SIZE];
                    int len;

                    while ((len = in.read(b, 0, BUFFER_SIZE)) != -1) {
                        zip.write(b, 0, len);
                    }

                    zip.close();
                    in.close();
                    file.delete();
                } catch (Exception e) {
                    System.err.println("Error gzipping " + file);
                    System.err.println(e.toString());
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

    super();
    closed = false;
    this.response = response;
    this.output = response.getOutputStream();
    baos = new ByteArrayOutputStream();
    gzipstream = new GZIPOutputStream(baos);
  }
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

            msg.not.expiration -= time;

          // Writes a serializable object to this output stream.
          if (compressedFlows) {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            GZIPOutputStream gzipos = new GZIPOutputStream(baos);
           
            oos = new ObjectOutputStream(gzipos);
            oos.writeObject(msg.not);

            // Be careful, the reset writes a TC_RESET byte
            oos.reset();
            // The OOS flush call the flush of this output stream.
            oos.flush();
            gzipos.finish();
            gzipos.flush();
           
            if (getLogger().isLoggable(BasicLevel.DEBUG))
              getLogger().log(BasicLevel.DEBUG, "writeNotification - size=" + baos.size());

            writeInt(baos.size());
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

      m_Log.statusMessage("Saving model to file...");
     
      try {
  OutputStream os = new FileOutputStream(sFile);
  if (sFile.getName().endsWith(".gz")) {
    os = new GZIPOutputStream(os);
  }
  ObjectOutputStream objectOutputStream = new ObjectOutputStream(os);
  objectOutputStream.writeObject(classifier);
  if (trainHeader != null) objectOutputStream.writeObject(trainHeader);
  objectOutputStream.flush();
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

        return bos.toByteArray_clear();
    }

    public static byte[] toGzipCompressedBytes(final Object obj) {
        final FastMultiByteArrayOutputStream bos = new FastMultiByteArrayOutputStream();
        final GZIPOutputStream gos;
        try {
            gos = new GZIPOutputStream(bos);
        } catch (IOException e) {
            throw new IllegalStateException(e);
        }
        toStream(obj, gos);
        return bos.toByteArray_clear();
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

            Debug.printStackTrace( e );
          }
        }
      }
     
      GZIPOutputStream  os = new GZIPOutputStream( new FileOutputStream( getGlobalStateFile()));
     
      try{
       
        os.write( BEncoder.encode( map ));
       
        os.close();
       
      }catch( IOException e ){
       
        Debug.printStackTrace( e );
     
        try{
          os.close();
         
        }catch( IOException f ){
         
        }
      }
View Full Code Here

Examples of java.util.zip.GZIPOutputStream

       
        if ( gzip_data == null ){
           
          ByteArrayOutputStream tos = new ByteArrayOutputStream(data.length);
         
          GZIPOutputStream gos = new GZIPOutputStream( tos );
         
          gos.write( data );
         
          gos.close();
         
          gzip_data = tos.toByteArray();
         
          root.put( "_gzipdata", gzip_data );
        }
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.