По данным MSDN:
ContentLength - указывает длину в байтах контента, отправляемого клиентом.
TotalBytes - количество байтов в текущем входном потоке.
InputStream.Length - длина байтов во входном потоке.
Итак, последние два одинаковы. Вот что Reflector говорит о свойстве ContentLength:
public int ContentLength
{
get
{
if ((this._contentLength == -1) && (this._wr != null))
{
string knownRequestHeader = this._wr.GetKnownRequestHeader(11);
if (knownRequestHeader != null)
{
try
{
this._contentLength = int.Parse(knownRequestHeader, CultureInfo.InvariantCulture);
}
catch
{
}
}
else if (this._wr.IsEntireEntityBodyIsPreloaded())
{
byte[] preloadedEntityBody = this._wr.GetPreloadedEntityBody();
if (preloadedEntityBody != null)
{
this._contentLength = preloadedEntityBody.Length;
}
}
}
if (this._contentLength < 0)
{
return 0;
}
return this._contentLength;
}
}