Esempio n. 1
0
 internal static Stream CreateDecoderStream(CMethodId id, Stream[] inStreams, byte[] info, IPasswordProvider pass,
                                            long limit)
 {
     switch (id.Id)
     {
         case k_Copy:
             if (info != null)
                 throw new NotSupportedException();
             return inStreams.Single();
         case k_LZMA:
         case k_LZMA2:
             return new LzmaStream(info, inStreams.Single(), -1, limit);
     #if !NO_CRYPTO
         case CMethodId.kAESId:
             return new AesDecoderStream(inStreams.Single(), info, pass, limit);
     #endif
         case k_BCJ:
             return new BCJFilter(false, inStreams.Single());
         case k_BCJ2:
             return new Bcj2DecoderStream(inStreams, info, limit);
         case k_BZip2:
             return new BZip2Stream(inStreams.Single(), CompressionMode.Decompress, true);
         case k_PPMD:
             return new PpmdStream(new PpmdProperties(info), inStreams.Single(), false);
         default:
             throw new NotSupportedException();
     }
 }
Esempio n. 2
0
 static CMethodId()
 {
     kCopy = new CMethodId(0L);
     kLzma = new CMethodId(0x30101L);
     kLzma2 = new CMethodId(0x21L);
     kAES = new CMethodId(0x6f10701L);
 }
Esempio n. 3
0
 static CMethodId()
 {
     kCopy  = new CMethodId(0L);
     kLzma  = new CMethodId(0x30101L);
     kLzma2 = new CMethodId(0x21L);
     kAES   = new CMethodId(0x6f10701L);
 }
Esempio n. 4
0
        internal static Stream CreateDecoderStream(CMethodId id, Stream[] inStreams, byte[] info, IPasswordProvider pass, long limit)
        {
            switch (id.Id)
            {
                case 0L:
                    if (info != null)
                    {
                        throw new NotSupportedException();
                    }
                    return Enumerable.Single<Stream>(inStreams);

                case 0x21L:
                case 0x30101L:
                    return new LzmaStream(info, Enumerable.Single<Stream>(inStreams), -1L, limit);

                case 0x3030103L:
                    return new BCJFilter(false, Enumerable.Single<Stream>(inStreams));

                case 0x303011bL:
                    return new Bcj2DecoderStream(inStreams, info, limit);

                case 0x30401L:
                    return new PpmdStream(new PpmdProperties(info), Enumerable.Single<Stream>(inStreams), false);

                case 0x40202L:
                    return new BZip2Stream(Enumerable.Single<Stream>(inStreams), CompressionMode.Decompress, true, false);
            }
            throw new NotSupportedException();
        }
Esempio n. 5
0
 public bool Equals(CMethodId other)
 {
     return (this.Id == other.Id);
 }
Esempio n. 6
0
 public bool Equals(CMethodId other)
 {
     return(this.Id == other.Id);
 }