Package org.apache.commons.compress.compressors

Examples of org.apache.commons.compress.compressors.CompressorInputStream


    public void produce( final DataConsumer pReceiver ) throws IOException {

        InputStream is = new BufferedInputStream(new FileInputStream(archive));

        CompressorInputStream compressorInputStream = null;

        try {
            compressorInputStream = new CompressorStreamFactory().createCompressorInputStream(is);
        } catch (CompressorException e) {
            // expected if the input file is a zip archive
View Full Code Here


        final File f = dropExtension(file);
        final File tempFile = File.createTempFile(dropExtension(f).getName(), getExtension(f));
        tempFile.deleteOnExit();
        BufferedInputStream in = null;
        FileOutputStream out = null;
        CompressorInputStream compressorIn = null;
        try {
            in = new BufferedInputStream(new FileInputStream(file));
            out = new FileOutputStream(tempFile);
            compressorIn = new CompressorStreamFactory().createCompressorInputStream(in);
            final byte[] buffer = new byte[1024];
            int i;
            while ((i = compressorIn.read(buffer)) != -1) {
                out.write(buffer, 0, i);
            }
        } catch (CompressorException e) {
            throw new IOException(e);
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.commons.compress.compressors.CompressorInputStream

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.