Examples of LzmaEncoder


Examples of lzma.LzmaEncoder

        ByteBuffer bbu = bb.duplicate();
        ByteBuffer bbc = ByteBuffer.allocateDirect(bbu.limit() + 13);
        bbc.order(ByteOrder.LITTLE_ENDIAN);
       
        LzmaEncoder enc = new LzmaEncoder();
        if (!enc.setLcLpPb(lc, lp, pb)) {
            throw new IOException("Invalid LZMA props");
        }
        if (!enc.setDictionarySize(dictSize)) {
            throw new IOException("Invalid dictionary size");
        }
        enc.setEndMarkerMode(true);
       
        bbc.put(enc.getCoderProperties());
        bbc.putLong(bbu.limit());
       
        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
        executor.scheduleAtFixedRate(new ByteBufferProgress(bbu), 2, 2, TimeUnit.SECONDS);
       
        try {
            InputStream is = new ByteBufferInputStream(bbu);
            OutputStream os = new ByteBufferOutputStream(bbc);
            enc.code(is, os);
        } finally {
            executor.shutdown();
        }
       
        bbc.flip();
View Full Code Here

Examples of org.glassfish.grizzly.compression.lzma.LZMAEncoder

        this(null);
    }

    public LZMAContentEncoding(EncodingFilter encodingFilter) {
        decoder = new LZMADecoder();
        encoder = new LZMAEncoder();
        if (encodingFilter != null) {
            this.encodingFilter = encodingFilter;
        } else {
            this.encodingFilter = new EncodingFilter() {
                @Override
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.