ComponentAce.Compression.Libs.zlib.ZStream.deflate C# (CSharp) 메소드

deflate() 공개 메소드

public deflate ( int flush ) : int
flush int
리턴 int
        public int deflate(int flush)
        {
            if (dstate == null)
            {
                return Z_STREAM_ERROR;
            }
            return dstate.deflate(this, flush);
        }

Usage Example

예제 #1
0
        public override void  Write(System.Byte[] b1, int off, int len)
        {
            if (len == 0)
            {
                return;
            }
            int err;

            byte[] b = new byte[b1.Length];
            System.Array.Copy(b1, 0, b, 0, b1.Length);
            z.next_in       = b;
            z.next_in_index = off;
            z.avail_in      = len;
            do
            {
                z.next_out       = buf;
                z.next_out_index = 0;
                z.avail_out      = bufsize;
                if (compress)
                {
                    err = z.deflate(flush_Renamed_Field);
                }
                else
                {
                    err = z.inflate(flush_Renamed_Field);
                }
                if (zlibConst.Z_OK != err)
                {
                    if (zlibConst.Z_STREAM_END == err)
                    {
                        out_Renamed.Write(buf, 0, bufsize - z.avail_out);
                        return;
                    }
                    else
                    {
                        throw new ZStreamException((compress ? "de" : "in") + "flating: " + z.msg);
                    }
                }
                else
                {
                    out_Renamed.Write(buf, 0, bufsize - z.avail_out);
                }

                /*if (err != zlibConst.Z_OK && err != zlibConst.Z_STREAM_END)
                 *      throw new ZStreamException((compress?"de":"in") + "flating: " + z.msg);*/
            }while (z.avail_in > 0 || z.avail_out == 0);
        }
All Usage Examples Of ComponentAce.Compression.Libs.zlib.ZStream::deflate