bytes / org.apache.tuweni.bytes / MutableBytes48

MutableBytes48

interface MutableBytes48 : MutableBytes, Bytes48 (source)

A mutable Bytes48, that is a mutable Bytes value of exactly 48 bytes.

Inherited Properties

EMPTY

static val EMPTY: MutableBytes

The empty value (with 0 bytes).

SIZE

static val SIZE: Int

The number of bytes in this value - i.e. 48

ZERO

static val ZERO: Bytes48

A Bytes48 containing all zero bytes

Functions

create

open static fun create(): MutableBytes48

Create a new mutable 48 bytes value.

wrap

open static fun wrap(value: ByteArray): MutableBytes48

Wrap a 48 bytes array as a mutable 48 bytes value.

open static fun wrap(value: ByteArray, offset: Int): MutableBytes48

Wrap a the provided array as a MutableBytes48.

Note that value is not copied, only wrapped, and thus any future update to value within the wrapped parts will be reflected in the returned value.

open static fun wrap(value: MutableBytes): MutableBytes48

Wrap a the provided value, which must be of size 48, as a MutableBytes48.

Note that value is not copied, only wrapped, and thus any future update to value will be reflected in the returned value.

open static fun wrap(value: MutableBytes, offset: Int): MutableBytes48

Wrap a slice/sub-part of the provided value as a MutableBytes48.

Note that the value is not copied, and thus any future update to value within the wrapped parts will be reflected in the returned value.

Inherited Functions

and

open fun and(other: Bytes48): Bytes48

Return a bit-wise AND of these bytes and the supplied bytes.

clear

open fun clear(): Unit

Set all bytes in this value to 0.

decrement

open fun decrement(): MutableBytes

Decrements the value of the bytes by 1, treating the value as big endian. If decrementing underflows the value then all bits flip, i.e. decrementing 0x0000 will return 0xFFFF.

fill

open fun fill(b: Byte): Unit

Fill all the bytes of this value with the specified byte.

increment

open fun increment(): MutableBytes

Increments the value of the bytes by 1, treating the value as big endian. If incrementing overflows the value then all bits flip, i.e. incrementing 0xFFFF will return 0x0000.

mutableSlice

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

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.

or

open fun or(other: Bytes48): Bytes48

Return a bit-wise OR of these bytes and the supplied bytes.

set

abstract fun set(i: Int, b: Byte): Unit

Set a byte in this value.

setInt

open fun setInt(i: Int, value: Int): Unit

Set the 4 bytes starting at the specified index to the specified integer value.

setLong

open fun setLong(i: Int, value: Long): Unit

Set the 8 bytes starting at the specified index to the specified long value.

xor

open fun xor(other: Bytes48): Bytes48

Return a bit-wise XOR of these bytes and the supplied bytes.