Package org.apache.commons.compress.compressors.pack200

Examples of org.apache.commons.compress.compressors.pack200.StreamBridge


            if (LZMA.equalsIgnoreCase(name)) {
                return new LZMACompressorInputStream(in);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorInputStream(in);
            }

            if (SNAPPY_RAW.equalsIgnoreCase(name)) {
                return new SnappyCompressorInputStream(in);
            }
View Full Code Here


            });
        setFactory(new CompressorStreamFactory() {
                public CompressorOutputStream
                    getCompressorStream(OutputStream stream)
                    throws IOException {
                    return new Pack200CompressorOutputStream(stream,
                                                             strategy
                                                             .getStrategy(),
                                                             properties);
                }
                public CompressorInputStream
View Full Code Here

    /**
     * @param stream the stream to write to, should be buffered
     */
    public CompressorOutputStream getCompressorStream(OutputStream stream)
        throws IOException {
        return new Pack200CompressorOutputStream(stream);
    }
View Full Code Here

            if (XZ.equalsIgnoreCase(name)) {
                return new XZCompressorOutputStream(out);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorOutputStream(out);
            }

        } catch (IOException e) {
            throw new CompressorException(
                    "Could not create CompressorOutputStream", e);
View Full Code Here

            if (XZ.equalsIgnoreCase(name)) {
                return new XZCompressorOutputStream(out);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorOutputStream(out);
            }

        } catch (IOException e) {
            throw new CompressorException(
                    "Could not create CompressorOutputStream", e);
View Full Code Here

            if (XZ.equalsIgnoreCase(name)) {
                return new XZCompressorOutputStream(out);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorOutputStream(out);
            }

        } catch (IOException e) {
            throw new CompressorException(
                    "Could not create CompressorOutputStream", e);
View Full Code Here

            if (XZ.equalsIgnoreCase(name)) {
                return new XZCompressorOutputStream(out);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorOutputStream(out);
            }

        } catch (IOException e) {
            throw new CompressorException(
                    "Could not create CompressorOutputStream", e);
View Full Code Here

            if (BZIP2.equalsIgnoreCase(name)) {
                return new BZip2CompressorOutputStream(out);
            }

            if (PACK200.equalsIgnoreCase(name)) {
                return new Pack200CompressorOutputStream(out);
            }

        } catch (IOException e) {
            throw new CompressorException(
                    "Could not create CompressorOutputStream", e);
View Full Code Here

        final File file1 = getFile("test1.xml");
        final File file2 = getFile("test2.xml");

        final OutputStream out =
            new Pack200CompressorOutputStream(new FileOutputStream(output),
                                              mode);
        try {
            final ArchiveOutputStream os = new ArchiveStreamFactory()
                .createArchiveOutputStream("jar", out);

            os.putArchiveEntry(new ZipArchiveEntry("testdata/test1.xml"));
            IOUtils.copy(new FileInputStream(file1), os);
            os.closeArchiveEntry();

            os.putArchiveEntry(new ZipArchiveEntry("testdata/test2.xml"));
            IOUtils.copy(new FileInputStream(file2), os);
            os.closeArchiveEntry();

            os.close();
        } finally {
            out.close();
        }

        final InputStream is = new Pack200CompressorInputStream(output);
        try {
            final ArchiveInputStream in = new ArchiveStreamFactory()
View Full Code Here

        final File output = new File(dir, "bla.pack");
        Map<String, String> m = new HashMap<String, String>();
        m.put("foo", "bar");
        final OutputStream out = new FileOutputStream(output);
        try {
            final OutputStream os = new Pack200CompressorOutputStream(out, m);
            os.write(1);
            os.write(new byte[] { 2, 3 });
            os.close();
        } finally {
            out.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.compress.compressors.pack200.StreamBridge

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.