FakeDataSet.FakeData
class FakeDataSet.FakeData
Container of fake data to be served by a FakeDataSource.
Summary
Nested types |
|---|
|
A segment of |
Public functions |
|
|---|---|
FakeDataSet.FakeData! |
@CanIgnoreReturnValueAppends an action. |
FakeDataSet.FakeData! |
Appends to the underlying data. |
FakeDataSet.FakeData! |
@CanIgnoreReturnValueAppends a data segment of the specified length. |
FakeDataSet.FakeData! |
@CanIgnoreReturnValueAppends an error in the underlying data. |
FakeDataSet! |
endData()Returns the |
ByteArray<Byte>! |
getData()Returns the whole data added by |
(Mutable)List<FakeDataSet.FakeData.Segment!>! |
Returns the list of |
Boolean |
Returns whether unknown length is simulated |
FakeDataSet.FakeData! |
@CanIgnoreReturnValueWhen set, |
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 FakeDataSource 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.
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.