System.Text.ISO2022Encoding.DecrementEscapeBytes C# (CSharp) Method

DecrementEscapeBytes() private method

private DecrementEscapeBytes ( byte &bytes, int &count ) : byte
bytes byte
count int
return byte
        private byte DecrementEscapeBytes(ref byte[] bytes, ref int count)
        {
            Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0");

            // Decrement our count
            count--;

            // Remember the first one
            byte returnValue = bytes[0];

            // Move them down one.
            for (int i = 0; i < count; i++)
            {
                bytes[i] = bytes[i + 1];
            }

            // Clear out the last byte
            bytes[count] = 0;

            // Return the old 1st byte
            return returnValue;
        }