ByteArrayContent.TryComputeLength Method
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Determines whether a byte array has a valid length in bytes.
Namespace: System.Net.Http
Assembly: System.Net.Http (in System.Net.Http.dll)
Parameters
- length
- Type: System.Int64%
The length in bytes of the byte array.
The TryComputeLength(Int64) method gives a derived content type the ability to calculate the content length. This is useful for content types which are able to easily calculate the content length. If computing the content length is not possible or expensive (would require the system to buffer the whole content where the serialization would be expensive or require the system to allocate a lot of memory), this method can return false. If this method returns false, this implies that either chunked transfer is needed or the content must get buffered before being sent to the server.
Windows 8 Release Preview, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.