Package SevenZip.Compression.LZMA

Examples of SevenZip.Compression.LZMA.Decoder


    for (int i = 0; i < 4; i++)
      dictionarySize += ((props[1 + i]) & 0xFF) << (i * 8);
   
    if(dictionarySize < 0) throw new InvalidCompressedDataException("Invalid dictionary size");
    if(dictionarySize > MAX_DICTIONARY_SIZE) throw new TooBigDictionaryException();
    Decoder decoder = new Decoder();
    if(!decoder.SetDecoderProperties(props)) throw new InvalidCompressedDataException("Invalid properties");
    decoder.Code(is, cos, maxLength);
    //cos.flush();
    return cos.written();
  }
View Full Code Here


    }

  @Override
  public long decompress(InputStream is, OutputStream os, long maxLength, long maxCheckSizeBytes) throws IOException, CompressionOutputSizeException {
    CountedOutputStream cos = new CountedOutputStream(os);
    Decoder decoder = new Decoder();
    decoder.SetDecoderProperties(props);
    decoder.Code(is, cos, maxLength);
    return cos.written();
  }
View Full Code Here

    DecoderThread(InputStream _in)
    {
        q = ConcurrentBufferOutputStream.newQueue();
        in = _in;
        out = ConcurrentBufferOutputStream.create(q);
        dec = new Decoder();
        exn = null;
        if (DEBUG)
        {
            dbg.printf("%s >> %s (%s)%n", this, out, q);
        }
View Full Code Here

     * At the point this function is called, we should have read the 12 byte SWF
     * Header already.
     */
    public LZMAInputStream(InputStream inputStream) throws IOException
    {
        decoder = new Decoder();
        this.inputStream = inputStream;
        initDecode();
    }
View Full Code Here

    final Decoder decoder;
    final InputStream stream;
    final long outSize;
   
    public DecodeThread(InputStream stream) throws IOException {
      this.decoder = new Decoder();
      byte[] properties = new byte[5];
      if (stream.read(properties, 0, properties.length) != properties.length)
        throw new IOException("unexpected end of stream");
      this.decoder.SetDecoderProperties(properties);
      long outSize = BinCoder.getInt8(stream);
View Full Code Here

            System.out.printf("Free: %d max: %d total: %d\n", Runtime.getRuntime().freeMemory(), Runtime.getRuntime().maxMemory(), Runtime.getRuntime().totalMemory());
           
            // Decompress
            InputStream compIn = new FileInputStream(fout);
            ByteArrayOutputStream decompOut = new ByteArrayOutputStream((int) fin.length());
            Decoder d = new Decoder();
            // Read props
            byte[] props = new byte[5];
            compIn.read(props);
            d.SetDecoderProperties(props);
            d.Code(compIn, decompOut, -1);
           
            System.out.printf("Done. Input size %d uncompressed size %d\n", fout.length(), decompOut.size());
           
           
        } catch(Exception e) {
View Full Code Here

    }
   
    public LZMAInputStream(InputStream compressedStream, int bufferSize) throws IOException {
        this.compressedStream = compressedStream;
       
        lzma = new Decoder();
       
        // Read the stream properties from the stream
        byte[] properties = new byte[5];
        int c = compressedStream.read(properties);
        if(c != properties.length) {
View Full Code Here

TOP

Related Classes of SevenZip.Compression.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.