MSDNによると:
ContentLength - クライアントから送信されるコンテンツの長さをバイト単位で指定します。
TotalBytes - 現在の入力ストリームのバイト数。
InputStream.Length - 入力ストリームのバイト長。
したがって、最後の 2 つは同じです。以下は、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;
}
}