tuweni / org.apache.tuweni.bytes / MutableBytes / mutableSlice


abstract fun mutableSlice(i: Int, length: Int): MutableBytes! (source)

Create a mutable slice of the bytes of this value.

Note: the resulting slice is only a view over the original value. Holding a reference to the returned slice may hold more memory than the slide represents. Use #copy on the returned slice to avoid this.


i - Int: The start index for the slice.

length - Int: The length of the resulting value.


IllegalArgumentException - if length < 0.

IndexOutOfBoundsException - if i < 0 or {i >= size()} or {i + length > size()} .

MutableBytes!: A new mutable view over the bytes of this value from index i (included) to index i + length (excluded).