de.caff.util

## Interface ByteCollector

- All Known Implementing Classes:
    ByteRingBuffer, TextLineRingBuffer

      public interface ByteCollector

  Byte collector interface.

  To byte collector you can append bytes.

  Since:
    August 12, 2022
  Author:
    Rammi

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default void` | `append(byte... bytes)` Append the given byte array to this buffer.
    `void` | `append(byte[] bytes, int offset, int length)` Append the given byte array part to this buffer.
    `void` | `append(int value)` Append one byte
    `void` | `clear()` Clear all data.
    `long` | `getNumberOfCollectedBytes()` Get the total number of bytes appended to this buffer.

- - ### Method Detail

    - #### append

          void append(int value)

      Append one byte
      Parameters:
        `value` - byte value. Accepts integer for convenience, but will cast the given value to byte.

    - #### append

          default void append(@NotNull
                              byte... bytes)

      Append the given byte array to this buffer.
      Parameters:
        `bytes` - bytes to append

    - #### append

          void append(@NotNull
                      byte[] bytes,
                      int offset,
                      int length)

      Append the given byte array part to this buffer.
      Parameters:
        `bytes` - basic byte array
        `offset` - start offset of the bytes to append
        `length` - number of bytes to append
      Throws:
        `java.lang.IndexOutOfBoundsException` - if the parameters define a part which is at least partially outside the `bytes`

    - #### clear

          void clear()

      Clear all data. This will clear everything but `the total number of bytes handled by this buffer`.

    - #### getNumberOfCollectedBytes

          long getNumberOfCollectedBytes()

      Get the total number of bytes appended to this buffer.
      Returns:
        total number of appended bytes