NetWrok.HTTP.Zlib.GZipStream.SlurpZeroTerminatedString C# (CSharp) Method

SlurpZeroTerminatedString() private method

private SlurpZeroTerminatedString ( byte buffer, int offset, int &count ) : string
buffer byte
offset int
count int
return string
        private string SlurpZeroTerminatedString(byte[] buffer, int offset, out int count)
        {
            var list = new System.Collections.Generic.List<byte>();
            bool done = false;
            count = 0;
            do
            {
                int ix = offset + count;
                if (buffer[ix] == 0)
                    done = true;
                else
                    list.Add(buffer[ix]);
                count++;
            } while (!done);
            byte[] a = list.ToArray();
            return GZipStream.iso8859dash1.GetString(a, 0, a.Length);
        }