Package org.apache.commons.compress.compressors.xz

Examples of org.apache.commons.compress.compressors.xz.XZCompressorInputStream


     *                          stream
     */
    public CompressorInputStream getCompressorStream(InputStream stream,
                                                     boolean decompressConcatenated)
        throws IOException {
        return new XZCompressorInputStream(stream, decompressConcatenated);
    }
View Full Code Here


    ByteArrayOutputStream baos = getOutputBuffer(data.remaining());
    InputStream bytesIn = new ByteArrayInputStream(
      data.array(),
      data.arrayOffset() + data.position(),
      data.remaining());
    InputStream ios = new XZCompressorInputStream(bytesIn);
    try {
      IOUtils.copy(ios, baos);
    } finally {
      ios.close();
    }
    return ByteBuffer.wrap(baos.toByteArray());
  }
View Full Code Here

                return new GzipCompressorInputStream(in, decompressConcatenated);
            }

            if (XZUtils.isXZCompressionAvailable() &&
                XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in, decompressConcatenated);
            }

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

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

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

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

    public void testConcatenatedStreamsReadFully() throws Exception {
        final File input = getFile("multiple.xz");
        final InputStream is = new FileInputStream(input);
        try {
            final CompressorInputStream in =
                new XZCompressorInputStream(is, true);
            try {
                assertEquals('a', in.read());
                assertEquals('b', in.read());
                assertEquals(0, in.available());
                assertEquals(-1, in.read());
            } finally {
                in.close();
            }
        } finally {
            is.close();
        }
    }
View Full Code Here

                return new GzipCompressorInputStream(in, decompressConcatenated);
            }

            if (XZUtils.isXZCompressionAvailable() &&
                XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in, decompressConcatenated);
            }

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

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

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

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

                return new GzipCompressorInputStream(in, decompressConcatenated);
            }

            if (XZUtils.isXZCompressionAvailable() &&
                XZCompressorInputStream.matches(signature, signatureLength)) {
                return new XZCompressorInputStream(in, decompressConcatenated);
            }

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

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

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

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

    public void testConcatenatedStreamsReadFully() throws Exception {
        final File input = getFile("multiple.xz");
        final InputStream is = new FileInputStream(input);
        try {
            final CompressorInputStream in =
                new XZCompressorInputStream(is, true);
            try {
                assertEquals('a', in.read());
                assertEquals('b', in.read());
                assertEquals(0, in.available());
                assertEquals(-1, in.read());
            } finally {
                in.close();
            }
        } finally {
            is.close();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.compress.compressors.xz.XZCompressorInputStream

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.