예제 #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:
                return(new LzmaDecoderStream(inStreams.Single(), info, limit));

            case k_LZMA2:
                return(new Lzma2DecoderStream(inStreams.Single(), info.Single(), limit));

            case CMethodId.kAESId:
                return(new AesDecoderStream(inStreams.Single(), info, pass, limit));

            case k_BCJ:
                return(new BcjDecoderStream(inStreams.Single(), info, limit));

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

            default:
                throw new NotSupportedException();
            }
        }
예제 #2
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:
             return new LzmaDecoderStream(inStreams.Single(), info, limit);
         case k_LZMA2:
             return new Lzma2DecoderStream(inStreams.Single(), info.Single(), limit);
         case CMethodId.kAESId:
             return new AesDecoderStream(inStreams.Single(), info, pass, limit);
         case k_BCJ:
             return new BcjDecoderStream(inStreams.Single(), info, limit);
         case k_BCJ2:
             return new Bcj2DecoderStream(inStreams, info, limit);
         default:
             throw new NotSupportedException();
     }
 }
예제 #3
0
 public bool Equals(CMethodId other)
 {
     return Id == other.Id;
 }
예제 #4
0
 public bool Equals(CMethodId other)
 {
     return(Id == other.Id);
 }