Examples of XZInputStream


Examples of org.tukaani.xz.XZInputStream

    } else if(b1 == 0xFD && b2 == '7') {
      // See http://tukaani.org/xz/xz-javadoc/org/tukaani/xz/XZInputStream.html
      // Set a memory limit of 64mb, if this is not sufficient, it will throw
      // an exception rather than an OutOfMemoryError, which will terminate the JVM
      return new XZInputStream(new FileInputStream(file), 64 * 1024 * 1024);
     
    } else if (b1 == 'B' && b2 == 'Z' && b3 == 'h' ) {
      return new BZip2CompressorInputStream(new FileInputStream(file));
   
    } else {
View Full Code Here

Examples of org.tukaani.xz.XZInputStream

     */
    public XZCompressorInputStream(InputStream inputStream,
                                   boolean decompressConcatenated)
            throws IOException {
        if (decompressConcatenated) {
            in = new XZInputStream(inputStream);
        } else {
            in = new SingleXZInputStream(inputStream);
        }
    }
View Full Code Here

Examples of org.tukaani.xz.XZInputStream

     */
    public XZCompressorInputStream(InputStream inputStream,
                                   boolean decompressConcatenated)
            throws IOException {
        if (decompressConcatenated) {
            in = new XZInputStream(inputStream);
        } else {
            in = new SingleXZInputStream(inputStream);
        }
    }
View Full Code Here

Examples of org.tukaani.xz.XZInputStream

    public static void unXZFile(File input, File output) {
        FileInputStream fis = null;
        FileOutputStream fos = null;
        BufferedInputStream bis = null;
        XZInputStream xzis = null;
        try {
            fis = new FileInputStream(input);
            xzis = new XZInputStream(fis);
            fos = new FileOutputStream(output);

            final byte[] buffer = new byte[8192];
            int n = 0;
            while (-1 != (n = xzis.read(buffer))) {
                fos.write(buffer, 0, n);
            }

        } catch (IOException e) {
            App.settings.logStackTrace(e);
        } finally {
            try {
                if (fis != null) {
                    fis.close();
                }
                if (bis != null) {
                    bis.close();
                }
                if (fos != null) {
                    fos.close();
                }
                if (xzis != null) {
                    xzis.close();
                }
            } catch (IOException e) {
                App.settings.logStackTrace(e);
            }
        }
View Full Code Here

Examples of org.tukaani.xz.XZInputStream

    /**
     * {@inheritDoc}
     */
    @Override
    protected InputStream wrapDecompressInternal(InputStream in) throws IOException {
        return new XZInputStream(in);
    }
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.