DataSourceContractTest.FakeTransferListener


class DataSourceContractTest.FakeTransferListener : TransferListener


A TransferListener that only keeps track of the transferred bytes.

Summary

Public constructors

Public functions

Unit
onBytesTransferred(
    source: DataSource!,
    dataSpec: DataSpec!,
    isNetwork: Boolean,
    bytesTransferred: Int
)

Called incrementally during a transfer.

Unit
onTransferEnd(source: DataSource!, dataSpec: DataSpec!, isNetwork: Boolean)

Called when a transfer ends.

Unit
onTransferInitializing(
    source: DataSource!,
    dataSpec: DataSpec!,
    isNetwork: Boolean
)

Called when a transfer is being initialized.

Unit
onTransferStart(source: DataSource!, dataSpec: DataSpec!, isNetwork: Boolean)

Called when a transfer starts.

Public constructors

FakeTransferListener

FakeTransferListener()

Public functions

onBytesTransferred

fun onBytesTransferred(
    source: DataSource!,
    dataSpec: DataSpec!,
    isNetwork: Boolean,
    bytesTransferred: Int
): Unit

Called incrementally during a transfer.

Parameters
source: DataSource!

The source performing the transfer.

dataSpec: DataSpec!

Describes the data being transferred.

isNetwork: Boolean

Whether the data is transferred through a network.

bytesTransferred: Int

The number of bytes transferred since the previous call to this method.

onTransferEnd

fun onTransferEnd(source: DataSource!, dataSpec: DataSpec!, isNetwork: Boolean): Unit

Called when a transfer ends.

Parameters
source: DataSource!

The source performing the transfer.

dataSpec: DataSpec!

Describes the data being transferred.

isNetwork: Boolean

Whether the data is transferred through a network.

onTransferInitializing

fun onTransferInitializing(
    source: DataSource!,
    dataSpec: DataSpec!,
    isNetwork: Boolean
): Unit

Called when a transfer is being initialized.

Parameters
source: DataSource!

The source performing the transfer.

dataSpec: DataSpec!

Describes the data for which the transfer is initialized.

isNetwork: Boolean

Whether the data is transferred through a network.

onTransferStart

fun onTransferStart(source: DataSource!, dataSpec: DataSpec!, isNetwork: Boolean): Unit

Called when a transfer starts.

Parameters
source: DataSource!

The source performing the transfer.

dataSpec: DataSpec!

Describes the data being transferred.

isNetwork: Boolean

Whether the data is transferred through a network.