ImmutableByteArray.Builder


class ImmutableByteArray.Builder


Builder for ImmutableByteArray instances.

Summary

Public constructors

Constructs a new instance with a default initial capacity.

Builder(initialCapacity: Int)

Constructs a new instance with the provided initial capacity.

Public functions

ImmutableByteArray.Builder!

Add the provided byte to the builder.

ImmutableByteArray.Builder!

Add the contents of the provided array to this builder.

ImmutableByteArray.Builder!

Add the contents of the provided collection to this builder.

ImmutableByteArray.Builder!

Add the contents of the provided array to this builder.

ImmutableByteArray.Builder!

Cast the elements of the provided long[] with checkedCast and add them to the builder.

ImmutableByteArray.Builder!

Cast the elements of the provided int[] with checkedCast and add them to the builder.

ImmutableByteArray.Builder!

Cast the elements of the provided Collection with checkedCast and add them to the builder.

ImmutableByteArray.Builder!

Cast the provided long with checkedCast and add it to the builder.

ImmutableByteArray!

Returns the built array.

Public constructors

Builder

Builder()

Constructs a new instance with a default initial capacity.

Builder

Builder(initialCapacity: Int)

Constructs a new instance with the provided initial capacity.

Public functions

add

@CanIgnoreReturnValue
fun add(b: Byte): ImmutableByteArray.Builder!

Add the provided byte to the builder.

addAll

@CanIgnoreReturnValue
fun addAll(bytes: ByteArray!): ImmutableByteArray.Builder!

Add the contents of the provided array to this builder.

addAll

@CanIgnoreReturnValue
fun addAll(bytes: (Mutable)Collection<Byte!>!): ImmutableByteArray.Builder!

Add the contents of the provided collection to this builder.

addAll

@CanIgnoreReturnValue
fun addAll(bytes: ImmutableByteArray!): ImmutableByteArray.Builder!

Add the contents of the provided array to this builder.

addAllUnsigned

@CanIgnoreReturnValue
fun addAllUnsigned(bytes: LongArray!): ImmutableByteArray.Builder!

Cast the elements of the provided long[] with checkedCast and add them to the builder.

addAllUnsigned

@CanIgnoreReturnValue
fun addAllUnsigned(bytes: IntArray!): ImmutableByteArray.Builder!

Cast the elements of the provided int[] with checkedCast and add them to the builder.

addAllUnsigned

@CanIgnoreReturnValue
fun addAllUnsigned(bytes: (Mutable)Collection<Long!>!): ImmutableByteArray.Builder!

Cast the elements of the provided Collection with checkedCast and add them to the builder.

addUnsigned

@CanIgnoreReturnValue
fun addUnsigned(b: Long): ImmutableByteArray.Builder!

Cast the provided long with checkedCast and add it to the builder.

build

fun build(): ImmutableByteArray!

Returns the built array.