System.Runtime.Remoting.Channels.Http.HttpReadingStream.ReadToEnd C# (CSharp) Метод

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

public ReadToEnd ( ) : bool
Результат bool
        public virtual bool ReadToEnd()
        {
            // This will never be called at a point where it is valid
            //   for someone to use the remaining data, so we don't
            //   need to buffer it.
            
            byte[] buffer = new byte[16];
            int bytesRead = 0;
            do
            {
               bytesRead = Read(buffer, 0, 16);
            } while (bytesRead > 0);

            return bytesRead == 0;
        }  

Usage Example

Пример #1
0
        // Determine if it's possible to service another request
        public bool CanServiceAnotherRequest()
        {
            if (_keepAlive && (_requestStream != null))
            {
                if (_requestStream.FoundEnd || _requestStream.ReadToEnd())
                {
                    return(true);
                }
            }

            return(false);
        } // CanServiceAnotherRequest