예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
 private static ZStream GetDefaultZStream(bool nowrap)
 {
     ZStream z = new ZStream();
     z.inflateInit(nowrap);
     return z;
 }