Package com.google.android.exoplayer2.upstream

## Class Allocation

- java.lang.Object
- - com.google.android.exoplayer2.upstream.Allocation

-     public final class Allocation
      extends Object

  An allocation within a byte array.

  The allocation's length is obtained by calling `Allocator.getIndividualAllocationLength()` on the `Allocator` from which it was obtained.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `byte[]` | `data` | The array containing the allocated space.
    `int` | `offset` | The offset of the allocated space in `data`.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Allocation​(byte[] data, int offset)` |

  - ### Method Summary

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

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

- - ### Field Detail

    - #### data

          public final byte[] data

      The array containing the allocated space. The allocated space might not be at the start of the array, and so `offset` must be used when indexing into it.

    - #### offset

          public final int offset

      The offset of the allocated space in `data`.

  - ### Constructor Detail

    - #### Allocation

          public Allocation​(byte[] data,
                            int offset)

      Parameters:
        `data` - The array containing the allocated space.
        `offset` - The offset of the allocated space in `data`.