padTo

Pads this ByteArray to the specified length with zeros if it is too short.

If the array's length is less than len, a new ByteArray is created with additional zero bytes. If the array's length is equal to or greater than len, the original array is returned unchanged.

Return

A ByteArray of at least the specified length, padded with zeros if necessary.

Parameters

len

The desired length of the resulting ByteArray.