appendInt32

fun ByteStringBuilder.appendInt32(value: Int, validRange: IntRange = Int.MIN_VALUE..Int.MAX_VALUE): ByteStringBuilder

Appends a 32-bit signed integer to this ByteStringBuilder.

This function appends the value as four bytes to the end of this ByteStringBuilder. It also validates that the provided value is within the specified validRange. By default, the valid range is from Int.MIN_VALUE to Int.MAX_VALUE.

The bytes are appended in Big-Endian order.

Return

This ByteStringBuilder instance, allowing for chaining of operations.

Parameters

value

The integer value to append.

validRange

The valid range for the integer value. Defaults to Int.MIN_VALUE..Int.MAX_VALUE.

Throws