Package com.google.android.exoplayer2.testutil

## Class FakeSampleStream.FakeSampleStreamItem

- java.lang.Object
- - com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamItem

- Enclosing class:
    FakeSampleStream

      public static final class FakeSampleStream.FakeSampleStreamItem
      extends Object

  Item to customize a return value of `SampleStream.readData(com.google.android.exoplayer2.FormatHolder, com.google.android.exoplayer2.decoder.DecoderInputBuffer, int)`.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static FakeSampleStream.FakeSampleStreamItem` | `END_OF_STREAM_ITEM` | Item that designates the end of stream has been reached.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static FakeSampleStream.FakeSampleStreamItem` | `format​(Format format)` | Creates an item representing the provided format.
    `static FakeSampleStream.FakeSampleStreamItem` | `oneByteSample​(long timeUs)` | Creates an item representing a sample with the provided timestamp.
    `static FakeSampleStream.FakeSampleStreamItem` | `oneByteSample​(long timeUs, int flags)` | Creates an item representing a sample with the provided timestamp and flags.
    `static FakeSampleStream.FakeSampleStreamItem` | `sample​(long timeUs, int flags, byte[] sampleData)` | Creates an item representing a sample with the provided timestamp, flags and data.

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

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

- - ### Field Detail

    - #### END_OF_STREAM_ITEM

          public static final FakeSampleStream.FakeSampleStreamItem END_OF_STREAM_ITEM

      Item that designates the end of stream has been reached.

  - ### Method Detail

    - #### 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:
        `timeUs` - The timestamp of the sample.

    - #### oneByteSample

          public static FakeSampleStream.FakeSampleStreamItem oneByteSample​(long timeUs,
                                                                            @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:
        `timeUs` - The timestamp of the sample.
        `flags` - The sample `C.BufferFlags`.

    - #### sample

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

      Creates an item representing a sample with the provided timestamp, flags and data.
      Parameters:
        `timeUs` - The timestamp of the sample.
        `flags` - The sample `C.BufferFlags`.
        `sampleData` - The sample data.