ImmutableByteArray.Builder


public final class ImmutableByteArray.Builder


Builder for ImmutableByteArray instances.

Summary

Public constructors

Constructs a new instance with a default initial capacity.

Builder(int initialCapacity)

Constructs a new instance with the provided initial capacity.

Public methods

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

public Builder()

Constructs a new instance with a default initial capacity.

Builder

public Builder(int initialCapacity)

Constructs a new instance with the provided initial capacity.

Public methods

add

@CanIgnoreReturnValue
public ImmutableByteArray.Builder add(byte b)

Add the provided byte to the builder.

addAll

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAll(byte[] bytes)

Add the contents of the provided array to this builder.

addAll

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAll(Collection<Byte> bytes)

Add the contents of the provided collection to this builder.

addAll

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAll(ImmutableByteArray bytes)

Add the contents of the provided array to this builder.

addAllUnsigned

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAllUnsigned(long[] bytes)

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

addAllUnsigned

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAllUnsigned(int[] bytes)

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

addAllUnsigned

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addAllUnsigned(Collection<Long> bytes)

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

addUnsigned

@CanIgnoreReturnValue
public ImmutableByteArray.Builder addUnsigned(long b)

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

build

public ImmutableByteArray build()

Returns the built array.