Package com.google.android.exoplayer2.util

## Class LongArray

- java.lang.Object
- - com.google.android.exoplayer2.util.LongArray

-     public final class LongArray
      extends Object

  An append-only, auto-growing `long[]`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LongArray()` |
    `LongArray​(int initialCapacity)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(long value)` | Appends a value.
    `long` | `get​(int index)` | Returns the value at a specified index.
    `int` | `size()` | Returns the current size of the array.
    `long[]` | `toArray()` | Copies the current values into a newly allocated primitive array.

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

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

- - ### Constructor Detail

    - #### LongArray

          public LongArray()

    - #### LongArray

          public LongArray​(int initialCapacity)

      Parameters:
        `initialCapacity` - The initial capacity of the array.

  - ### Method Detail

    - #### add

          public void add​(long value)

      Appends a value.
      Parameters:
        `value` - The value to append.

    - #### get

          public long get​(int index)

      Returns the value at a specified index.
      Parameters:
        `index` - The index.
      Returns:
        The corresponding value.
      Throws:
        `IndexOutOfBoundsException` - If the index is less than zero, or greater than or equal to `size()`.

    - #### size

          public int size()

      Returns the current size of the array.

    - #### toArray

          public long[] toArray()

      Copies the current values into a newly allocated primitive array.
      Returns:
        The primitive array containing the copied values.