Package lzma.streams

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


        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

            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

        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

TOP

Related Classes of lzma.streams.LzmaInputStream

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.