open static fun wrap(value: ByteArray): Bytes
(source)
Wrap the provided byte array as a Bytes value.
Note that value is not copied and thus any future update to value
will be reflected in the returned value.
Return
A Bytes value wrapping value
.
open static fun wrap(value: ByteArray, offset: Int, length: Int): Bytes
(source)
Wrap a slice of a byte array as a Bytes value.
Note that value is not copied and thus any future update to value
within the slice will be reflected in the returned value.
offset
- The index (inclusive) in value
of the first byte exposed by the returned value. In other words, you will have wrap(value, o, l).get(0) == value[o]
.
length
- The length of the resulting value.
IndexOutOfBoundsException
- if offset < 0 || (value.length > 0 && offset >= value.length)
.
IllegalArgumentException
- if length < 0 || offset + length > value.length
.
Return
A Bytes value that expose the bytes of value
from offset
(inclusive) to offset + length
(exclusive).
open static fun wrap(vararg values: Bytes): Bytes
(source)
Wrap a list of other values into a concatenated view.
Note that the values are not copied and thus any future update to the values will be reflected in the returned value. If copying the inputs is desired, use #concatenate(Bytes...)
.
IllegalArgumentException
- if the result overflows an int.
Return
A value representing a view over the concatenation of all values
.