コード例 #1
0
 public Compressor(byte[] image)
 {
     buf1 = new MemoryStream();
     if (PDF.original_zlib) {
     ods1 = new OptionalDeflateStream(buf1);
     ods1.Write(image, 0, image.Length);
     ods1.Close();
     } else {
     dos1 = new DeflaterOutputStream(buf1, new Deflater());
     dos1.Write(image, 0, image.Length);
     dos1.Finish();
     }
 }
コード例 #2
0
        public DeflaterOutputStream(MemoryStream buf1, Deflater deflater)
        {
            this.buf1 = buf1;
            this.deflater = deflater;

            if (PDF.original_zlib) {
            ds2 = new OptionalDeflateStream(buf1);
            } else {
            buf2 = new MemoryStream();
            buf2.WriteByte(0x58);   // These are the correct values for
            buf2.WriteByte(0x85);   // CMF and FLG according to Microsoft
            ds1 = new DeflateStream(buf2, CompressionMode.Compress, true);
            }
        }
コード例 #3
0
 public Compressor(byte[] image)
 {
     buf1 = new MemoryStream();
     if (PDF.original_zlib)
     {
         ods1 = new OptionalDeflateStream(buf1);
         ods1.Write(image, 0, image.Length);
         ods1.Close();
     }
     else
     {
         dos1 = new DeflaterOutputStream(buf1, new Deflater());
         dos1.Write(image, 0, image.Length);
         dos1.Finish();
     }
 }
コード例 #4
0
        public DeflaterOutputStream(MemoryStream buf1, Deflater deflater)
        {
            this.buf1     = buf1;
            this.deflater = deflater;

            if (PDF.original_zlib)
            {
                ds2 = new OptionalDeflateStream(buf1);
            }
            else
            {
                buf2 = new MemoryStream();
                buf2.WriteByte(0x58); // These are the correct values for
                buf2.WriteByte(0x85); // CMF and FLG according to Microsoft
                ds1 = new DeflateStream(buf2, CompressionMode.Compress, true);
            }
        }