setExpectedLength

setExpectedLength(length: Integer64) updating;

The setExpectedLength method of the JadeBytes class specifies the expected total length of an empty JadeBytes object that will be assembled by using the appendData method. The expected length is taken into account when computing segment size.

Calling this method does not allocate any storage and the length remains set to zero (0).

Exception 1342 (JadeBytes maximum content size exceeded) is raised when the value of the setExpectedLength method parameter is greater than approximately 1,019G bytes.

An exception is raised if the JadeBytes object is not empty when the setExpectedLength method is called. Use the clear or purge method rather than truncate(0) or setContent(null) to empty a JadeBytes object.