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;
}
// 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