Java.Net.HttpURLConnection.SetChunkedStreamingMode Method
Stream a request body whose length is not known in advance.

Syntax

[Android.Runtime.Register("setChunkedStreamingMode", "(I)V", "GetSetChunkedStreamingMode_IHandler")]
public virtual void SetChunkedStreamingMode (int chunklen)

See Also

HttpURLConnection.SetFixedLengthStreamingMode(int)

Parameters

chunkLength
the length to use, or 0 for the default chunk length.

Exceptions

TypeReason
Java.Lang.IllegalStateExceptionif already connected or another mode already set.

Remarks

Stream a request body whose length is not known in advance. Old HTTP/1.0 only servers may not support this mode.

When HTTP chunked encoding is used, the stream is divided into chunks, each prefixed with a header containing the chunk's size. A large chunk length requires a large internal buffer, potentially wasting memory. A small chunk length increases the number of bytes that must be transmitted because of the header on every chunk.

Implementation details: In some releases the chunkLength is treated as a hint: chunks sent to the server may actually be larger or smaller. To force a chunk to be sent to the server call Java.IO.OutputStream.Flush.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1