public static final class FakeDataSet.FakeData extends Object
FakeDataSource.| Modifier and Type | Class | Description |
|---|---|---|
static class |
FakeDataSet.FakeData.Segment |
A segment of
FakeDataSet.FakeData. |
| Modifier and Type | Field | Description |
|---|---|---|
Uri |
uri |
Uri of the data or null if this is the default FakeData.
|
| Modifier and Type | Method | Description |
|---|---|---|
FakeDataSet.FakeData |
appendReadAction(Runnable action) |
Appends an action.
|
FakeDataSet.FakeData |
appendReadData(byte[] data) |
Appends to the underlying data.
|
FakeDataSet.FakeData |
appendReadData(int length) |
Appends a data segment of the specified length.
|
FakeDataSet.FakeData |
appendReadError(IOException exception) |
Appends an error in the underlying data.
|
FakeDataSet |
endData() |
Returns the
FakeDataSet this FakeData belongs to. |
byte[] |
getData() |
Returns the whole data added by
appendReadData(byte[]). |
List<FakeDataSet.FakeData.Segment> |
getSegments() |
Returns the list of
FakeDataSet.FakeData.Segments. |
boolean |
isSimulatingUnknownLength() |
Returns whether unknown length is simulated
|
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. |
@Nullable public final Uri uri
public FakeDataSet endData()
FakeDataSet this FakeData belongs to.public FakeDataSet.FakeData setSimulateUnknownLength(boolean simulateUnknownLength)
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)
public FakeDataSet.FakeData appendReadData(int length)
FakeDataSource will perform no copy operations when this data is read.public FakeDataSet.FakeData appendReadError(IOException exception)
public FakeDataSet.FakeData appendReadAction(Runnable action)
public byte[] getData()
appendReadData(byte[]).public List<FakeDataSet.FakeData.Segment> getSegments()
FakeDataSet.FakeData.Segments.public boolean isSimulatingUnknownLength()