System.IO.Compression.GZipStream.ReadByte C# (CSharp) Method

ReadByte() public method

public ReadByte ( ) : int
return int
        public override int ReadByte()
        {
            CheckDeflateStream();
            return _deflateStream.ReadByte();
        }

Usage Example

        public byte[] Decompress(byte[] input)
        {
            if (input == null)
            {
                throw new ArgumentNullException("input");
            }

            var output = new List<byte>();

            using (var ms = new MemoryStream(input))
            {
                var gs = new GZipStream(ms, CompressionMode.Decompress);
                var readByte = gs.ReadByte();

                while (readByte != -1)
                {
                    output.Add((byte)readByte);
                    readByte = gs.ReadByte();
                }

                gs.Close();
                ms.Close();
            }

            return output.ToArray();
        }
All Usage Examples Of System.IO.Compression.GZipStream::ReadByte