Package org.tukaani.xz

Examples of org.tukaani.xz.LZMA2Options


    }

    @Override
    OutputStream encode(final OutputStream out, final Object opts)
        throws IOException {
        LZMA2Options options = getOptions(opts);
        FinishableOutputStream wrapped = new FinishableWrapperOutputStream(out);
        return options.getOutputStream(wrapped);
    }
View Full Code Here


    private LZMA2Options getOptions(Object opts) throws IOException {
        if (opts instanceof LZMA2Options) {
            return (LZMA2Options) opts;
        }
        LZMA2Options options = new LZMA2Options();
        options.setDictSize(numberOptionOrDefault(opts));
        return options;
    }
View Full Code Here

    }

    @Test
    public void shouldAllowLZMA2OptionsForLZMA2() {
        Assert.assertNotNull(new SevenZMethodConfiguration(SevenZMethod.LZMA2,
                                                           new LZMA2Options())
                             .getOptions());
    }
View Full Code Here

                          .singletonList(new SevenZMethodConfiguration(SevenZMethod.LZMA2, 1 << 20)));
    }

    public void testLzma2WithOptionsConfiguration() throws Exception {
        output = new File(dir, "lzma2-options2.7z");
        LZMA2Options opts = new LZMA2Options(1);
        createAndReadBack(output, Collections
                          .singletonList(new SevenZMethodConfiguration(SevenZMethod.LZMA2, opts)));
    }
View Full Code Here

    }

    @Override
    OutputStream encode(final OutputStream out, final byte[] password)
        throws IOException {
        LZMA2Options options = new LZMA2Options();
        options.setDictSize(LZMA2Options.DICT_SIZE_DEFAULT);
        FinishableOutputStream wrapped = new FinishableWrapperOutputStream(out);
        return new FinishOnCloseStream(options.getOutputStream(wrapped));
    }
View Full Code Here

     * Creates a new XZ compressor using the default LZMA2 options.
     * This is equivalent to <code>XZCompressorOutputStream(6)</code>.
     */
    public XZCompressorOutputStream(OutputStream outputStream)
            throws IOException {
        out = new XZOutputStream(outputStream, new LZMA2Options());
    }
View Full Code Here

     * 16&nbsp;MiB, or 32&nbsp;MiB, it is waste of memory to use the
     * presets 7, 8, or 9, respectively.
     */
    public XZCompressorOutputStream(OutputStream outputStream, int preset)
            throws IOException {
        out = new XZOutputStream(outputStream, new LZMA2Options(preset));
    }
View Full Code Here

    }

    @Override
    OutputStream encode(final OutputStream out, final byte[] password)
        throws IOException {
        LZMA2Options options = new LZMA2Options();
        options.setDictSize(LZMA2Options.DICT_SIZE_DEFAULT);
        FinishableOutputStream wrapped = new FinishableWrapperOutputStream(out);
        return options.getOutputStream(wrapped);
    }
View Full Code Here

     * Creates a new XZ compressor using the default LZMA2 options.
     * This is equivalent to <code>XZCompressorOutputStream(6)</code>.
     */
    public XZCompressorOutputStream(OutputStream outputStream)
            throws IOException {
        out = new XZOutputStream(outputStream, new LZMA2Options());
    }
View Full Code Here

     * 16&nbsp;MiB, or 32&nbsp;MiB, it is waste of memory to use the
     * presets 7, 8, or 9, respectively.
     */
    public XZCompressorOutputStream(OutputStream outputStream, int preset)
            throws IOException {
        out = new XZOutputStream(outputStream, new LZMA2Options(preset));
    }
View Full Code Here

TOP

Related Classes of org.tukaani.xz.LZMA2Options

Copyright © 2018 www.massapicom. 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.