public final class

FakeDataSet.FakeData

extends java.lang.Object

 java.lang.Object

↳androidx.media3.test.utils.FakeDataSet.FakeData

Overview

Container of fake data to be served by a FakeDataSource.

Summary

Fields
public final Uriuri

Uri of the data or null if this is the default FakeData.

Methods
public FakeDataSet.FakeDataappendReadAction(java.lang.Runnable action)

Appends an action.

public FakeDataSet.FakeDataappendReadData(byte[] data[])

Appends to the underlying data.

public FakeDataSet.FakeDataappendReadData(int length)

Appends a data segment of the specified length.

public FakeDataSet.FakeDataappendReadError(java.io.IOException exception)

Appends an error in the underlying data.

public FakeDataSetendData()

Returns the FakeDataSet this FakeData belongs to.

public byte[]getData()

Returns the whole data added by FakeDataSet.FakeData.appendReadData(byte[]).

public java.util.List<FakeDataSet.FakeData.Segment>getSegments()

Returns the list of FakeDataSet.FakeData.Segments.

public booleanisSimulatingUnknownLength()

Returns whether unknown length is simulated

public FakeDataSet.FakeDatasetSimulateUnknownLength(boolean simulateUnknownLength)

When set, FakeDataSource.open(DataSpec) will behave as though the source is unable to determine the length of the underlying data.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public final Uri uri

Uri of the data or null if this is the default FakeData.

Methods

public FakeDataSet endData()

Returns the FakeDataSet this FakeData belongs to.

public FakeDataSet.FakeData setSimulateUnknownLength(boolean simulateUnknownLength)

When set, FakeDataSource.open(DataSpec) will behave as though the source is unable to determine the length of the underlying data. Hence the return value will always be equal to the DataSpec.length of the argument, including the case where the length is equal to C.LENGTH_UNSET.

public FakeDataSet.FakeData appendReadData(byte[] data[])

Appends to the underlying data.

public FakeDataSet.FakeData appendReadData(int length)

Appends a data segment of the specified length. No actual data is available and the FakeDataSource will perform no copy operations when this data is read.

public FakeDataSet.FakeData appendReadError(java.io.IOException exception)

Appends an error in the underlying data.

public FakeDataSet.FakeData appendReadAction(java.lang.Runnable action)

Appends an action.

public byte[] getData()

Returns the whole data added by FakeDataSet.FakeData.appendReadData(byte[]).

public java.util.List<FakeDataSet.FakeData.Segment> getSegments()

Returns the list of FakeDataSet.FakeData.Segments.

public boolean isSimulatingUnknownLength()

Returns whether unknown length is simulated