當前位置: 首頁>>代碼示例>>C#>>正文


C# Zlib.ZStream類代碼示例

本文整理匯總了C#中Org.BouncyCastle.Utilities.Zlib.ZStream的典型用法代碼示例。如果您正苦於以下問題:C# ZStream類的具體用法?C# ZStream怎麽用?C# ZStream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ZStream類屬於Org.BouncyCastle.Utilities.Zlib命名空間,在下文中一共展示了ZStream類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: DeflateOutputStream

			public DeflateOutputStream(Stream output, ZStream z, bool compress)
				: base(output)
			{
				this.z = z;
				this.compress = compress;
				this.FlushMode = JZlib.Z_PARTIAL_FLUSH;
			}
開發者ID:randombit,項目名稱:hacrypto,代碼行數:7,代碼來源:TlsDeflateCompression.cs

示例2: TlsDeflateCompression

        public TlsDeflateCompression(int level)
        {
            this.zIn = new ZStream();
            this.zIn.inflateInit();

            this.zOut = new ZStream();
            this.zOut.deflateInit(level);
        }
開發者ID:JohnMalmsteen,項目名稱:mobile-apps-tower-defense,代碼行數:8,代碼來源:TlsDeflateCompression.cs

示例3: DeflateOutputStream

 public DeflateOutputStream(Stream output, ZStream z, bool compress)
     : base(output)
 {
     this.z = z;
     this.compress = compress;
     // TODO http://www.bolet.org/~pornin/deflate-flush.html says we should use Z_SYNC_FLUSH
     this.FlushMode = JZlib.Z_PARTIAL_FLUSH;
 }
開發者ID:medvedttn,項目名稱:itextsharp_mod-src,代碼行數:8,代碼來源:TlsDeflateCompression.cs

示例4: TlsDeflateCompression

		public TlsDeflateCompression()
		{
			this.zIn = new ZStream();
			this.zIn.inflateInit();

			this.zOut = new ZStream();
			// TODO Allow custom setting
			this.zOut.deflateInit(JZlib.Z_DEFAULT_COMPRESSION);
		}
開發者ID:randombit,項目名稱:hacrypto,代碼行數:9,代碼來源:TlsDeflateCompression.cs

示例5: DeflateOutputStream

            public DeflateOutputStream(Stream output, ZStream z, bool compress)
                : base(output, z)
            {
                this.compress = compress;

                /*
                 * See discussion at http://www.bolet.org/~pornin/deflate-flush.html .
                 */
                this.FlushMode = JZlib.Z_SYNC_FLUSH;
            }
開發者ID:JohnMalmsteen,項目名稱:mobile-apps-tower-defense,代碼行數:10,代碼來源:TlsDeflateCompression.cs

示例6: CompressedStream

		public CompressedStream (Stream baseStream)
		{
			BaseStream = baseStream;

			zOut = new ZStream ();
			zOut.deflateInit (5, true);
			zOut.next_out = new byte[4096];

			zIn = new ZStream ();
			zIn.inflateInit (true);
			zIn.next_in = new byte[4096];
		}
開發者ID:dcga,項目名稱:MailKit,代碼行數:12,代碼來源:CompressedStream.cs

示例7: ZOutputStream

        public ZOutputStream(Stream output, ZStream z)
			: base()
		{
			Debug.Assert(output.CanWrite);

            if (z == null)
            {
                z = new ZStream();
                z.inflateInit();
            }

            this.output = output;
            this.z = z;
			this.compress = false;
		}
開發者ID:JohnMalmsteen,項目名稱:mobile-apps-tower-defense,代碼行數:15,代碼來源:ZOutputStream.cs

示例8: ZOutputStream

        public ZOutputStream(Stream output, ZStream z)
			: base()
		{
			Debug.Assert(output.CanWrite);

            if (z == null)
            {
                z = new ZStream();
            }

            if (z.istate == null && z.dstate == null)
            {
                z.inflateInit();
            }

            this.output = output;
            this.compress = (z.istate == null);
            this.z = z;
		}
開發者ID:gkardava,項目名稱:WinPass,代碼行數:19,代碼來源:ZOutputStream.cs

示例9: ZInputStream

        public ZInputStream(Stream input, ZStream z)
			: base()
		{
			Debug.Assert(input.CanRead);

            if (z == null)
            {
                z = new ZStream();
            }

            if (z.istate == null && z.dstate == null)
            {
                z.inflateInit();
            }

            this.input = input;
            this.compress = (z.istate == null);
            this.z = z;
            this.z.next_in = buf;
			this.z.next_in_index = 0;
			this.z.avail_in = 0;
		}
開發者ID:gkardava,項目名稱:WinPass,代碼行數:22,代碼來源:ZInputStream.cs

示例10: free

 internal void free(ZStream z){
     reset(z, null);
     window=null;
     hufts=null;
     //ZFREE(z, s);
 }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:6,代碼來源:InfBlocks.cs

示例11: reset

        internal void reset(ZStream z, long[] c){
            if(c!=null) c[0]=check;
            if(mode==BTREE || mode==DTREE){
            }
            if(mode==CODES){
                codes.free(z);
            }
            mode=TYPE;
            bitk=0;
            bitb=0;
            read=write=0;

            if(checkfn != null)
                z.adler=check=z._adler.adler32(0L, null, 0, 0);
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:15,代碼來源:InfBlocks.cs

示例12: inflateSync

        internal int inflateSync(ZStream z)
        {
            int n;       // number of bytes to look at
            int p;       // pointer to bytes
            int m;       // number of marker bytes found in a row
            long r, w;   // temporaries to save total_in and total_out

            // set up
            if(z == null || z.istate == null)
                return Z_STREAM_ERROR;
            if(z.istate.mode != BAD){
                z.istate.mode = BAD;
                z.istate.marker = 0;
            }
            if((n=z.avail_in)==0)
                return Z_BUF_ERROR;
            p=z.next_in_index;
            m=z.istate.marker;

            // search
            while (n!=0 && m < 4){
                if(z.next_in[p] == mark[m]){
                    m++;
                }
                else if(z.next_in[p]!=0){
                    m = 0;
                }
                else{
                    m = 4 - m;
                }
                p++; n--;
            }

            // restore
            z.total_in += p-z.next_in_index;
            z.next_in_index = p;
            z.avail_in = n;
            z.istate.marker = m;

            // return no joy or set up to restart on a new block
            if(m != 4){
                return Z_DATA_ERROR;
            }
            r=z.total_in;  w=z.total_out;
            inflateReset(z);
            z.total_in=r;  z.total_out = w;
            z.istate.mode = BLOCKS;
            return Z_OK;
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:49,代碼來源:Inflate.cs

示例13: deflateSetDictionary

        internal int deflateSetDictionary (ZStream strm, byte[] dictionary, int dictLength){
            int length = dictLength;
            int index=0;

            if(dictionary == null || status != INIT_STATE)
                return Z_STREAM_ERROR;

            strm.adler=strm._adler.adler32(strm.adler, dictionary, 0, dictLength);

            if(length < MIN_MATCH) return Z_OK;
            if(length > w_size-MIN_LOOKAHEAD){
                length = w_size-MIN_LOOKAHEAD;
                index=dictLength-length; // use the tail of the dictionary
            }
            System.Array.Copy(dictionary, index, window, 0, length);
            strstart = length;
            block_start = length;

            // Insert all strings in the hash table (except for the last two bytes).
            // s->lookahead stays null, so s->ins_h will be recomputed at the next
            // call of fill_window.

            ins_h = window[0]&0xff;
            ins_h=(((ins_h)<<hash_shift)^(window[1]&0xff))&hash_mask;

            for(int n=0; n<=length-MIN_MATCH; n++){
                ins_h=(((ins_h)<<hash_shift)^(window[(n)+(MIN_MATCH-1)]&0xff))&hash_mask;
                prev[n&w_mask]=head[ins_h];
                head[ins_h]=(short)n;
            }
            return Z_OK;
        }
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:32,代碼來源:Deflate.cs

示例14: inflateReset

        internal int inflateReset(ZStream z)
        {
            if(z == null || z.istate == null) return Z_STREAM_ERROR;

            z.total_in = z.total_out = 0;
            z.msg = null;
            z.istate.mode = z.istate.nowrap!=0 ? BLOCKS : METHOD;
            z.istate.blocks.reset(z, null);
            return Z_OK;
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:10,代碼來源:Inflate.cs

示例15: inflateSetDictionary

        internal int inflateSetDictionary(ZStream z, byte[] dictionary, int dictLength)
        {
            int index=0;
            int length = dictLength;
            if(z==null || z.istate == null|| z.istate.mode != DICT0)
                return Z_STREAM_ERROR;

            if(z._adler.adler32(1L, dictionary, 0, dictLength)!=z.adler){
                return Z_DATA_ERROR;
            }

            z.adler = z._adler.adler32(0, null, 0, 0);

            if(length >= (1<<z.istate.wbits)){
                length = (1<<z.istate.wbits)-1;
                index=dictLength - length;
            }
            z.istate.blocks.set_dictionary(dictionary, index, length);
            z.istate.mode = BLOCKS;
            return Z_OK;
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:21,代碼來源:Inflate.cs


注:本文中的Org.BouncyCastle.Utilities.Zlib.ZStream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。