ImmutableByteArray.Builder
public final class ImmutableByteArray.Builder
Builder for ImmutableByteArray instances.
Summary
Public constructors |
|---|
Builder()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 |
@CanIgnoreReturnValueAdd the provided |
ImmutableByteArray.Builder |
@CanIgnoreReturnValueAdd the contents of the provided array to this builder. |
ImmutableByteArray.Builder |
@CanIgnoreReturnValueAdd the contents of the provided collection to this builder. |
ImmutableByteArray.Builder |
Add the contents of the provided array to this builder. |
ImmutableByteArray.Builder |
@CanIgnoreReturnValueCast the elements of the provided |
ImmutableByteArray.Builder |
@CanIgnoreReturnValueCast the elements of the provided |
ImmutableByteArray.Builder |
Cast the elements of the provided |
ImmutableByteArray.Builder |
@CanIgnoreReturnValueCast the provided |
ImmutableByteArray |
build()Returns the built array. |
Public constructors
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.