FakeDataSet.FakeData


class FakeDataSet.FakeData


Container of fake data to be served by a FakeDataSource.

Summary

Nested types

A segment of FakeData.

Public functions

FakeDataSet.FakeData!

Appends an action.

FakeDataSet.FakeData!

Appends to the underlying data.

FakeDataSet.FakeData!

Appends a data segment of the specified length.

FakeDataSet.FakeData!

Appends an error in the underlying data.

FakeDataSet!

Returns the FakeDataSet this FakeData belongs to.

ByteArray<Byte>!

Returns the whole data added by appendReadData.

(Mutable)List<FakeDataSet.FakeData.Segment!>!

Returns the list of Segments.

Boolean

Returns whether unknown length is simulated

FakeDataSet.FakeData!

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

Public properties

Uri?

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

Public functions

appendReadAction

@CanIgnoreReturnValue
fun appendReadAction(action: Runnable!): FakeDataSet.FakeData!

Appends an action.

appendReadData

@CanIgnoreReturnValue
fun appendReadData(data: ByteArray!): FakeDataSet.FakeData!

Appends to the underlying data.

appendReadData

@CanIgnoreReturnValue
fun appendReadData(length: Int): FakeDataSet.FakeData!

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

appendReadError

@CanIgnoreReturnValue
fun appendReadError(exception: IOException!): FakeDataSet.FakeData!

Appends an error in the underlying data.

endData

fun endData(): FakeDataSet!

Returns the FakeDataSet this FakeData belongs to.

getData

fun getData(): ByteArray<Byte>!

Returns the whole data added by appendReadData.

getSegments

fun getSegments(): (Mutable)List<FakeDataSet.FakeData.Segment!>!

Returns the list of Segments.

isSimulatingUnknownLength

fun isSimulatingUnknownLength(): Boolean

Returns whether unknown length is simulated

setSimulateUnknownLength

@CanIgnoreReturnValue
fun setSimulateUnknownLength(simulateUnknownLength: Boolean): FakeDataSet.FakeData!

When set, open 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 length of the argument, including the case where the length is equal to LENGTH_UNSET.

Public properties

uri

val uriUri?

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