/// <summary>Decompress the byte array previously returned by
        /// compress
        /// </summary>
        public static byte[] Decompress(byte[] value_Renamed)
        {
            // Create an expandable byte array to hold the decompressed data
            System.IO.MemoryStream bos = new System.IO.MemoryStream(value_Renamed.Length);

            Inflater decompressor = SharpZipLib.CreateInflater();

            try
            {
                decompressor.SetInput(value_Renamed);

                // Decompress the data
                byte[] buf = new byte[1024];
                while (!decompressor.IsFinished)
                {
                    int count = decompressor.Inflate(buf);
                    bos.Write(buf, 0, count);
                }
            }
            finally
            {
            }

            return(bos.ToArray());
        }
Example #2
0
        /// <summary>
        /// Decompress the byte array previously returned by
        ///  compress
        /// </summary>
        public static byte[] Decompress(sbyte[] value, int offset, int length)
        {
            // Create an expandable byte array to hold the decompressed data
            ByteArrayOutputStream bos = new ByteArrayOutputStream(length);

            Inflater decompressor = SharpZipLib.CreateInflater();

            try
            {
                decompressor.SetInput((byte[])(Array)value);

                // Decompress the data
                byte[] buf = new byte[1024];
                while (!decompressor.IsFinished)
                {
                    int count = decompressor.Inflate(buf);
                    bos.Write(buf, 0, count);
                }
            }
            finally
            {
            }

            return(bos.ToArray());
        }
Example #3
0
 internal DeflateDecompressor()
 {
     decompressor = SharpZipLib.CreateInflater();
     Compressed   = new byte[0];
 }