org.apache.hc.client5.http.auth.util

## Class ByteArrayBuilder

- java.lang.Object
- - org.apache.hc.client5.http.auth.util.ByteArrayBuilder

    @Immutable
    public class ByteArrayBuilder
    extends Object

Builder class for sequences of bytes.

Since:
  5.0

### Constructor Summary

Constructors
Constructor and Description
`ByteArrayBuilder()`
`ByteArrayBuilder(int initialCapacity)`

### Method Summary

Methods
`ByteArrayBuilder` `append(byte[] b)`
`ByteArrayBuilder` `append(byte[] b, int off, int len)`
`ByteArrayBuilder` `append(char[] b)`
`ByteArrayBuilder` `append(char[] b, int off, int len)`
`ByteArrayBuilder` `append(CharBuffer charBuffer)`
`ByteArrayBuilder` `append(String s)`
`int` `capacity()`
`ByteArrayBuilder` `charset(Charset charset)`
`void` `ensureFreeCapacity(int freeCapacity)`
`void` `reset()`
`byte[]` `toByteArray()`
`ByteBuffer` `toByteBuffer()`
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### ByteArrayBuilder

    public ByteArrayBuilder()

#### ByteArrayBuilder

    public ByteArrayBuilder(int initialCapacity)

### Method Detail

#### capacity

    public int capacity()

#### ensureFreeCapacity

    public void ensureFreeCapacity(int freeCapacity)

#### charset

    public ByteArrayBuilder charset(Charset charset)

#### append

    public ByteArrayBuilder append(byte[] b,
                          int off,
                          int len)

#### append

    public ByteArrayBuilder append(byte[] b)

#### append

    public ByteArrayBuilder append(CharBuffer charBuffer)

#### append

    public ByteArrayBuilder append(char[] b,
                          int off,
                          int len)

#### append

    public ByteArrayBuilder append(char[] b)

#### append

    public ByteArrayBuilder append(String s)

#### toByteBuffer

    public ByteBuffer toByteBuffer()

#### toByteArray

    public byte[] toByteArray()

#### reset

    public void reset()

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`