appendUInt16Le

fun ByteStringBuilder.appendUInt16Le(value: UInt, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder

Appends a 16-bit unsigned integer to this ByteStringBuilder in Little-Endian order.

This function appends the value as two 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 UShort.MIN_VALUE to UShort.MAX_VALUE.

The bytes are appended in Little-Endian order.

Return

This ByteStringBuilder instance, allowing for chaining of operations.

Parameters

value

The unsigned integer value to append.

validRange

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

Throws


fun ByteStringBuilder.appendUInt16Le(value: Int, validRange: UIntRange = UShort.MIN_VALUE..UShort.MAX_VALUE): ByteStringBuilder

Appends a 16-bit unsigned integer to this ByteStringBuilder in Little-Endian order.

This function appends the value as two 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 UShort.MIN_VALUE to UShort.MAX_VALUE.

The bytes are appended in Little-Endian order.

Return

This ByteStringBuilder instance, allowing for chaining of operations.

Parameters

value

The integer value to append.

validRange

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

Throws