Examples of LZMAInputStream


Examples of LZMA.LzmaInputStream

    }

    @Override
    public InputStream openStream() throws IOException
    {
        return new LzmaInputStream(this.compressedData);
    }
View Full Code Here

Examples of LZMA.LzmaInputStream

            if (binpatchesCompressed==null)
            {
                FMLRelaunchLog.log(Level.ERROR, "The binary patch set is missing. Either you are in a development environment, or things are not going to work!");
                return;
            }
            LzmaInputStream binpatchesDecompressed = new LzmaInputStream(binpatchesCompressed);
            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

Examples of lzma.streams.LzmaInputStream

     
      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

Examples of lzma.streams.LzmaInputStream

        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

Examples of lzma.streams.LzmaInputStream

            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) {
                remaining -= read;
            } else {
                break;
            }
        }

        assertEquals(0, is.available());
        assertEquals(-1, is.read());
        assertEquals(-1, lzmaIs.read());

        is.close();
        lzmaIs.close();
        out.release();

        return uncompressed;
    }
View Full Code Here

Examples of lzma.streams.LzmaInputStream

        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 {
                    break;
                }
            }
            assertEquals(0, is.available());
            assertEquals(-1, is.read());

            is.close();
            lzmaIs.close();
            msg.release();
        }

        assertArrayEquals(data, uncompressed);
    }
View Full Code Here

Examples of net.contrapunctus.lzma.LzmaInputStream

         
        });
        is = pis;
      } else if(ctype == COMPRESSOR_TYPE.LZMA) {
        if(logMINOR) Logger.minor(this, "dealing with LZMA");
        is = new LzmaInputStream(data.getInputStream());
        wrapper = null;
      } else {
        wrapper = null;
      }
View Full Code Here

Examples of net.contrapunctus.lzma.LzmaInputStream

        final File uncompressed = new File(dest, file.getName().substring(0,
                file.getName().lastIndexOf('.')));
       
        final FileInputStream fileInput = new FileInputStream(file);
       
        InputStream in = new LzmaInputStream(fileInput);
       
        OutputStream out = new FileOutputStream(uncompressed);
       
        final byte[] buffer = new byte[16384];
       
        int ret = in.read(buffer);
        while (ret >= 1)
        {
            out.write(buffer, 0, ret);
            ret = in.read(buffer);
        }
       
        in.close();
        out.close();
       
        in = null;
        out = null;
       
View Full Code Here

Examples of org.tukaani.xz.LZMAInputStream

                dictSize |= (coder.properties[i + 1] & 0xffl) << (8 * i);
            }
            if (dictSize > LZMAInputStream.DICT_SIZE_MAX) {
                throw new IOException("Dictionary larger than 4GiB maximum size");
            }
            return new LZMAInputStream(in, -1, propsByte, (int) dictSize);
        }
View Full Code Here

Examples of org.tukaani.xz.LZMAInputStream

     *                          by this implementation, or the underlying
     *                          <code>inputStream</code> throws an exception
     */
    public LZMACompressorInputStream(InputStream inputStream)
            throws IOException {
        in = new LZMAInputStream(inputStream);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.