ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream.Write C# (CSharp) Метод

Write() публичный Метод

Writes bytes from an array to the compressed stream.
public Write ( byte buffer, int offset, int count ) : void
buffer byte /// The byte array ///
offset int /// The offset into the byte array where to start. ///
count int /// The number of bytes to write. ///
Результат void
        public override void Write(byte[] buffer, int offset, int count)
        {
            deflater_.SetInput(buffer, offset, count);
            Deflate();
        }

Usage Example

Пример #1
21
        public byte[] Compress(byte[] bytData, params int[] ratio)
        {
            int compRatio = 9;
            try
            {
                if (ratio[0] > 0)

                {
                    compRatio = ratio[0];
                }
            }
            catch
            {
                throw;
            }

            try
            {
                var ms = new MemoryStream();
                var defl = new Deflater(compRatio, false);
                Stream s = new DeflaterOutputStream(ms, defl);
                s.Write(bytData, 0, bytData.Length);
                s.Close();
                byte[] compressedData = ms.ToArray();
                 return compressedData;
            }
            catch
            {
                throw;

            }
        }
All Usage Examples Of ICSharpCode.SharpZipLib.Zip.Compression.Streams.DeflaterOutputStream::Write