# FakeSampleStream.FakeSampleStreamItem

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

*** ** * ** ***


```
public final class FakeSampleStream.FakeSampleStreamItem
```

<br />

*** ** * ** ***

Item to customize a return value of `https://developer.android.com/reference/androidx/media3/exoplayer/source/SampleStream#readData(androidx.media3.exoplayer.FormatHolder,androidx.media3.decoder.DecoderInputBuffer,int)`.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem#END_OF_STREAM_ITEM()` Item that designates the end of stream has been reached. |

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem#format(androidx.media3.common.Format)(https://developer.android.com/reference/androidx/media3/common/Format format)` Creates an item representing the provided format. |
| `static https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem#oneByteSample(long)(long timeUs)` Creates an item representing a sample with the provided timestamp. |
| `static https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem#oneByteSample(long,int)(long timeUs, @https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flags)` Creates an item representing a sample with the provided timestamp and flags. |
| `static https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem` | `https://developer.android.com/reference/androidx/media3/test/utils/FakeSampleStream.FakeSampleStreamItem#sample(long,int,byte[])(long timeUs, @https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flags, byte[] sampleData)` Creates an item representing a sample with the provided timestamp, flags and data. |

## Constants

### END_OF_STREAM_ITEM

```
public static final FakeSampleStream.FakeSampleStreamItem END_OF_STREAM_ITEM
```

Item that designates the end of stream has been reached.

## Public methods

### format

```
public static FakeSampleStream.FakeSampleStreamItem format(Format format)
```

Creates an item representing the provided format.

### oneByteSample

```
public static FakeSampleStream.FakeSampleStreamItem oneByteSample(long timeUs)
```

Creates an item representing a sample with the provided timestamp.

The sample will contain a single byte of data.

| Parameters |
|---|---|
| `long timeUs` | The timestamp of the sample. |

### oneByteSample

```
public static FakeSampleStream.FakeSampleStreamItem oneByteSample(long timeUs, @C.BufferFlags int flags)
```

Creates an item representing a sample with the provided timestamp and flags.

The sample will contain a single byte of data.

| Parameters |
|---|---|
| `long timeUs` | The timestamp of the sample. |
| `@https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flags` | The sample `https://developer.android.com/reference/androidx/media3/common/C.BufferFlags`. |

### sample

```
public static FakeSampleStream.FakeSampleStreamItem sample(long timeUs, @C.BufferFlags int flags, byte[] sampleData)
```

Creates an item representing a sample with the provided timestamp, flags and data.

| Parameters |
|---|---|
| `long timeUs` | The timestamp of the sample. |
| `@https://developer.android.com/reference/androidx/media3/common/C.BufferFlags int flags` | The sample `https://developer.android.com/reference/androidx/media3/common/C.BufferFlags`. |
| `byte[] sampleData` | The sample data. |