# Allocation

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/upstream/Allocation.java+class:androidx.media3.exoplayer.upstream.Allocation)

*** ** * ** ***


```
@UnstableApi
public final class Allocation
```

<br />

*** ** * ** ***

An allocation within a byte array.

The allocation's length is obtained by calling `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator#getIndividualAllocationLength()` on the `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocator` from which it was obtained.

## Summary

| ### Public fields |
|---|---|
| `final byte[]` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#data()` The array containing the allocated space. |
| `final int` | `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#offset()` The offset of the allocated space in `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#data()`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#Allocation(byte[],int)(byte[] data, int offset)` |

## Public fields

### 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 `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#offset()` must be used when indexing into it.

### offset

```
public final int offset
```

The offset of the allocated space in `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/Allocation#data()`.

## Public constructors

### Allocation

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

| Parameters |
|---|---|
| `byte[] data` | The array containing the allocated space. |
| `int offset` | The offset of the allocated space in `data`. |