Package lzma.sdk.lzma

Examples of lzma.sdk.lzma.Decoder


     
      LineNumberReader br;
      if (parsedArgs.mySqlFile.equals("-")) {
        br = new LineNumberReader(new InputStreamReader(System.in));
      } else if (mySqlFile.getName().endsWith("7z")) {
        br = new LineNumberReader(new InputStreamReader(new LzmaInputStream(new BufferedInputStream(new FileInputStream(mySqlFile)), new Decoder())));
        assert mySqlFile.canRead();
      } else {
        br = new LineNumberReader(new FileReader(mySqlFile));
        assert mySqlFile.canRead();
      }
View Full Code Here


        Pattern matcher = Pattern.compile(String.format("binpatch/merged/.*.binpatch"));

        JarInputStream jis;
        try
        {
            LzmaInputStream binpatchesDecompressed = new LzmaInputStream(new FileInputStream(getPatches()), new Decoder());
            ByteArrayOutputStream jarBytes = new ByteArrayOutputStream();
            JarOutputStream jos = new JarOutputStream(jarBytes);
            Pack200.newUnpacker().unpack(binpatchesDecompressed, jos);
            jis = new JarInputStream(new ByteArrayInputStream(jarBytes.toByteArray()));
        }
View Full Code Here

        byte[] properties = new byte[propertiesSize];
        if (in.read(properties, 0, propertiesSize) != propertiesSize)
        {
            throw new IOException("input .lzma file is too short");
        }
        Decoder decoder = new Decoder();
        if (!decoder.setDecoderProperties(properties))
        {
            throw new IOException("Incorrect stream properties");
        }
        long outSize = 0;
        for (int i = 0; i < 8; i++)
        {
            int v = in.read();
            if (v < 0)
            {
                throw new IOException("Can't read stream size");
            }
            outSize |= ((long) v) << (8 * i);
        }
        if (!decoder.code(in, out, outSize))
        {
            throw new IOException("Error in data stream");
        }
        out.flush();
        out.close();
View Full Code Here

        IOUtils.copy(in, out);
        in.close();
        out.close();

        in = new LzmaInputStream(new BufferedInputStream(new FileInputStream(compressedFile)), new Decoder());
        out = new BufferedOutputStream(new FileOutputStream(decompressedFile));

        IOUtils.copy(in, out);
        in.close();
        out.close();
View Full Code Here

        Thread.sleep(1000);

        System.out.println(" o Stream decompression");
        in =
                new LzmaInputStream(new BufferedInputStream(new FileInputStream(compressedFile)),
                        new Decoder());
        out = new BufferedOutputStream(new FileOutputStream(decompressedFile));

        IOUtils.copy(in, out);
        in.close();
        out.close();
View Full Code Here

    final InputStream compressedFileStream = FileUtils
        .openInputStream(new File("target/test-classes/hello.txt.lzma"));

    @SuppressWarnings("unchecked")
    final List<String> lines = IOUtils.readLines(new LzmaInputStream(
        compressedFileStream, new Decoder()));

    assertEquals(1, lines.size());
    assertEquals("Hello World !", lines.get(0));
  }
View Full Code Here

        int outOffset = 0;

        ByteBuf msg;
        while ((msg = channel.readOutbound()) != null) {
            InputStream is = new ByteBufInputStream(msg);
            LzmaInputStream lzmaIs = new LzmaInputStream(is, new Decoder());
            for (;;) {
                int read = lzmaIs.read(uncompressed, outOffset, data.length - outOffset);
                if (read > 0) {
                    outOffset += read;
                } else {
View Full Code Here

            out.addComponent(msg);
            out.writerIndex(out.writerIndex() + msg.readableBytes());
        }

        InputStream is = new ByteBufInputStream(out);
        LzmaInputStream lzmaIs = new LzmaInputStream(is, new Decoder());
        byte[] uncompressed = new byte[length];
        int remaining = length;
        while (remaining > 0) {
            int read = lzmaIs.read(uncompressed, length - remaining, remaining);
            if (read > 0) {
View Full Code Here

TOP

Related Classes of lzma.sdk.lzma.Decoder

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.