Examples of deflate()


Examples of java.util.zip.Deflater.deflate()

      inputBytes[a] = 1;

    Deflater deflater = new Deflater(Deflater.BEST_SPEED);
    deflater.setInput(inputBytes);
    deflater.finish();
    deflater.deflate(compressedData);
    harness.check(true);
  }
}
View Full Code Here

Examples of java.util.zip.Deflater.deflate()

    try {
      Deflater compressor = new Deflater(Deflater.BEST_SPEED);
      byte[] compressed = new byte[src.length + 100];
      compressor.setInput(src);
      compressor.finish();
      int totalOut = compressor.deflate(compressed);
      byte[] zipsrc = new byte[totalOut];
      System.arraycopy(compressed, 0, zipsrc, 0, totalOut);
      compressor.end();
      return codec.encode(zipsrc);
    } catch (Exception e) {
View Full Code Here

Examples of java.util.zip.Deflater.deflate()

        // Write the compressed data to the stream
        byte[] buf = new byte[1024];
        while (!compressor.finished())
        {
            int count = compressor.deflate(buf);
            bos.write(buf, 0, count);
        }
    }

View Full Code Here

Examples of java.util.zip.Deflater.deflate()

        ByteArrayOutputStream bos = new ByteArrayOutputStream(input.length);

        // Compress the data
        byte[] buf = new byte[1024];
        while (!compressor.finished()) {
            int count = compressor.deflate(buf);
            bos.write(buf, 0, count);
        }
        try {
            bos.close();
        } catch (IOException e) {
View Full Code Here

Examples of java.util.zip.Deflater.deflate()

        // Write the compressed data to the stream
        byte[] buf = new byte[1024];
        while (!compressor.finished())
        {
            int count = compressor.deflate(buf);
            bos.write(buf, 0, count);
        }
    }

View Full Code Here

Examples of java.util.zip.Deflater.deflate()

                            byte[] uncompressed = entityText.getBytes("utf-8");
                            Deflater compressor = new Deflater(Deflater.DEFAULT_COMPRESSION, rfc1951);
                            compressor.setInput(uncompressed);
                            compressor.finish();
                            byte[] output = new byte[100];
                            int compressedLength = compressor.deflate(output);
                            byte[] compressed = new byte[compressedLength];
                            System.arraycopy(output, 0, compressed, 0, compressedLength);
                            response.setEntity(new InputStreamEntity(
                                    new ByteArrayInputStream(compressed), compressedLength));
                            return;
View Full Code Here

Examples of org.apache.cassandra.config.CFMetaData.deflate()

            throw new ConfigurationException("Keyspace does not already exist.");
       
        CFMetaData oldCfm = DatabaseDescriptor.getCFMetaData(CFMetaData.getId(cf_def.keyspace.toString(), cf_def.name.toString()));
       
        // create a copy of the old CF meta data. Apply new settings on top of it.
        this.metadata = CFMetaData.inflate(oldCfm.deflate());
        this.metadata.apply(cf_def);
       
        // create a copy of the old KS meta data. Use it to create a RowMutation that gets applied to schema and migrations.
        KSMetaData newKsMeta = KSMetaData.inflate(ksm.deflate());
        newKsMeta.cfMetaData().get(cf_def.name.toString()).apply(cf_def);
View Full Code Here

Examples of org.apache.cassandra.config.ColumnDefinition.deflate()

                                                     org.apache.cassandra.thrift.IndexType.KEYS,
                                                     createIdx.getIndexName());
                }
               
                CfDef cfamilyDef = CFMetaData.convertToAvro(oldCfm);
                cfamilyDef.column_metadata.add(columnDef.deflate());
               
                try
                {
                    applyMigrationOnStage(new UpdateColumnFamily(cfamilyDef));
                }
View Full Code Here

Examples of org.apache.cassandra.config.KSMetaData.deflate()

        RowMutation rm = new RowMutation(Table.SYSTEM_TABLE, versionKey);
        long now = System.currentTimeMillis();
        for (String ksname : ksnames)
        {
            KSMetaData ksm = DatabaseDescriptor.getTableDefinition(ksname);
            rm.add(new QueryPath(Migration.SCHEMA_CF, null, ByteBufferUtil.bytes(ksm.name)), SerDeUtils.serialize(ksm.deflate()), now);
        }
        // add the schema
        rm.add(new QueryPath(Migration.SCHEMA_CF,
                             null,
                             DEFINITION_SCHEMA_COLUMN_NAME),
View Full Code Here

Examples of org.apache.mina.filter.support.Zlib.deflate()

        ByteBuffer inBuffer = (ByteBuffer) writeRequest.getMessage();
        if (!inBuffer.hasRemaining()) {
            // Ignore empty buffers
            nextFilter.filterWrite(session, writeRequest);
        } else {
            ByteBuffer outBuf = deflater.deflate(inBuffer);
            inBuffer.release();
            nextFilter.filterWrite(session, new WriteRequest(outBuf,
                    writeRequest.getFuture()));
        }
    }
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.