Examples of compress()


Examples of com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress()

            } else if (fileType.equals(FileType.HTML_FILE) || fileType.equals(FileType.XHTML_FILE)) {
                final HtmlCompressor compressor = new HtmlCompressor();
                out.write(compressor.compress(readerToString(in)));
            } else if (fileType.equals(FileType.XML_FILE)){
                final XmlCompressor compressor = new XmlCompressor();
                out.write(compressor.compress(readerToString(in)));
            }

            // close all streams
            in.close();
            in = null;
View Full Code Here

Examples of com.zwl.util.ZipUtil.compress()

    Date date = new Date();
    Drawpng.createPng(context.getRealPath("/") + "/jbpm/jbpm"
        + date.getYear() + date.getMonth() + date.getDate()
        + ".jpdl.xml");// 生成图片
    ZipUtil z = new ZipUtil();
    z.compress(
        context.getRealPath("/") + "/jbpm",
        context.getRealPath("/") + "/jbpm/jbpm" + date.getYear()
            + date.getMonth() + date.getDate() + ".zip", "", false);// 压缩成zip文件
    request.getSession().setAttribute("zip", context.getRealPath("/") + "/jbpm/jbpm"
        + date.getYear() + date.getMonth() + date.getDate() + ".zip");
View Full Code Here

Examples of net.jpountz.lz4.LZ4Compressor.compress()

    // compress data
    LZ4Compressor compressor = factory.fastCompressor();
    int maxCompressedLength = compressor.maxCompressedLength(decompressedLength);
    byte[] compressed = new byte[maxCompressedLength];
    int compressedLength = compressor.compress(data, 0, decompressedLength, compressed, 0, maxCompressedLength);

    // decompress data
    // - method 1: when the decompressed length is known
    LZ4FastDecompressor decompressor = factory.fastDecompressor();
    byte[] restored = new byte[decompressedLength];
View Full Code Here

Examples of net.sf.cram.structure.Block.compress()

    Block block = new Block();
    block.setRawContent(toByteArray(samFileHeader));
    block.method = BlockCompressionMethod.RAW.ordinal();
    block.contentId = 0;
    block.contentType = BlockContentType.FILE_HEADER;
    block.compress();

    Container c = new Container();
    c.blockCount = 1;
    c.blocks = new Block[] { block };
    c.landmarks = new int[0];
View Full Code Here

Examples of org.ajax4jsf.css.CssCompressor.compress()

      responseWriter.flush();
      responseWriter.close();
     
      if (_CompressStyleOn) {   
            CssCompressor compressor = new CssCompressor(countingOutputWriter.getContent()); // Compressing css document and printing result in response stream
            bytesLength = compressor.compress(writer, -1);
            writer.flush();
            writer.close();
      } else {
            writer.write(countingOutputWriter.getContent().toString())// Write not compressed style content
            bytesLength = countingOutputWriter.getWritten();
View Full Code Here

Examples of org.apache.activemq.command.Message.compress()

        if (message.getOriginalTransactionId() == null) {
            message.setOriginalTransactionId(message.getTransactionId());
        }
        message.setTransactionId(null);
        if (configuration.isUseCompression()) {
            message.compress();
        }
        return message;
    }

    protected void serviceLocalCommand(Command command) {
View Full Code Here

Examples of org.apache.avro.file.codec.CustomCodec.compress()

    ByteBuffer original = ByteBuffer.allocate(testString.getBytes().length);
    original.put(testString.getBytes());
    original.rewind();
    ByteBuffer decompressed = null;
    try {
      ByteBuffer compressed = customCodec.compress(original);
      compressed.rewind();
      decompressed = customCodec.decompress(compressed);
    } catch (IOException e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of org.apache.commons.imaging.common.mylzw.MyLzwCompressor.compress()

                    imagedata[y * width + x] = (byte) index;
                }
            }

            final byte[] compressed = compressor.compress(imagedata);
            writeAsSubBlocks(bos, compressed);
//            image_data_total += compressed.length;
        }

        // palette2.dump();
View Full Code Here

Examples of org.apache.hadoop.hive.ql.io.orc.OrcFile.WriterOptions.compress()

        if (formatVersion != null) {
            options.version(formatVersion);
        }
        CompressionKind compressionKind = conf.getCompressionKind();
        if (compressionKind != null) {
            options.compress(compressionKind);
        }
        Long stripeSize = conf.getStripeSize();
        if (stripeSize != null) {
            options.stripeSize(stripeSize);
        }
View Full Code Here

Examples of org.apache.hadoop.io.compress.lz4.Lz4Compressor.compress()

  public void testCompressorCompressNullPointerException() {
    try {
      Lz4Compressor compressor = new Lz4Compressor();
      byte[] bytes = generate(1024 * 6);
      compressor.setInput(bytes, 0, bytes.length);
      compressor.compress(null, 0, 0);
      fail("testCompressorCompressNullPointerException error !!!");
    } catch (NullPointerException ex) {
      // expected
    } catch (Exception e) {
      fail("testCompressorCompressNullPointerException ex error !!!");
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.