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

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


            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


            if (GzipCompressorInputStream.matches(signature, signatureLength)) {
                return new GzipCompressorInputStream(in);
            }

            if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
                return new Pack200CompressorInputStream(in);
            }

        } catch (IOException e) {
            throw new CompressorException("Failed to detect Compressor from InputStream.", e);
        }
View Full Code Here

            if (BZIP2.equalsIgnoreCase(name)) {
                return new BZip2CompressorInputStream(in);
            }

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

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

    private void jarUnarchiveAll(boolean useFile, Pack200Strategy mode)
        throws Exception {
        final File input = getFile("bla.pack");
        final InputStream is = useFile
            ? new Pack200CompressorInputStream(input, mode)
            : new Pack200CompressorInputStream(new FileInputStream(input),
                                               mode);
        try {
            final ArchiveInputStream in = new ArchiveStreamFactory()
                .createArchiveInputStream("jar", is);
View Full Code Here

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

        final InputStream is = new Pack200CompressorInputStream(output);
        try {
            final ArchiveInputStream in = new ArchiveStreamFactory()
                .createArchiveInputStream("jar", is);
            List<String> files = new ArrayList<String>();
            files.add("testdata/test1.xml");
            files.add("testdata/test2.xml");
            checkArchiveContent(in, files);
            in.close();
        } finally {
            is.close();
        }
    }
View Full Code Here

    public void testInputStreamMethods() throws Exception {
        Map<String, String> m = new HashMap<String, String>();
        m.put("foo", "bar");
        final InputStream is =
            new Pack200CompressorInputStream(new FileInputStream(getFile("bla.jar")),
                                             m);
        try {
            // packed file is a jar, which is a zip so it starts with
            // a local file header
            assertTrue(is.markSupported());
            is.mark(5);
            assertEquals(0x50, is.read());
            byte[] rest = new byte[3];
            assertEquals(3, is.read(rest));
            assertEquals(0x4b, rest[0]);
            assertEquals(3, rest[1]);
            assertEquals(4, rest[2]);
            assertEquals(1, is.skip(1));
            is.reset();
            assertEquals(0x50, is.read());
            assertTrue(is.available() > 0);
        } finally {
            is.close();
        }
    }
View Full Code Here

            if (XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in);
            }

            if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
                return new Pack200CompressorInputStream(in);
            }

        } catch (IOException e) {
            throw new CompressorException("Failed to detect Compressor from InputStream.", e);
        }
View Full Code Here

            if (XZ.equalsIgnoreCase(name)) {
                return new XZCompressorInputStream(in);
            }

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

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

            else if (MT_GZIP.equals(type)) {
                final CompressorInputStream compressedStream = new GzipCompressorInputStream(bufferedResourceStream);
                importDataArchive(archive, compressedStream, options);
            }
            else if (MT_PACK200.equals(type)) {
                final CompressorInputStream compressedStream = new Pack200CompressorInputStream(bufferedResourceStream);
                importDataArchive(archive, compressedStream, options);
            }
            else if (MT_XZ.equals(type)) {
                final CompressorInputStream compressedStream = new XZCompressorInputStream(bufferedResourceStream);
                importDataArchive(archive, compressedStream, options);
View Full Code Here

                XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in, decompressConcatenated);
            }

            if (Pack200CompressorInputStream.matches(signature, signatureLength)) {
                return new Pack200CompressorInputStream(in);
            }

            if (FramedSnappyCompressorInputStream.matches(signature, signatureLength)) {
                return new FramedSnappyCompressorInputStream(in);
            }
View Full Code Here

TOP

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

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.