Back to Exoplayer

DataSourceContractTest.FakeTransferListener (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/DataSourceContractTest.FakeTransferListener.html

latest5.0 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class DataSourceContractTest.FakeTransferListener


public static classDataSourceContractTest.FakeTransferListenerextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[TransferListener](../upstream/TransferListener.html "interface in com.google.android.exoplayer2.upstream")

A TransferListener that only keeps track of the transferred bytes.

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | FakeTransferListener() | |

Method Summary

All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | onBytesTransferred​(DataSource source, DataSpec dataSpec, boolean isNetwork, int bytesTransferred) | Called incrementally during a transfer. | | void | onTransferEnd​(DataSource source, DataSpec dataSpec, boolean isNetwork) | Called when a transfer ends. | | void | onTransferInitializing​(DataSource source, DataSpec dataSpec, boolean isNetwork) | Called when a transfer is being initialized. | | void | onTransferStart​(DataSource source, DataSpec dataSpec, boolean isNetwork) | Called when a transfer starts. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

FakeTransferListener

public FakeTransferListener()

Method Detail

- 

onTransferInitializing

public void onTransferInitializing​([DataSource](../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                                   boolean isNetwork)

Description copied from interface: TransferListener

Called when a transfer is being initialized. Specified by:onTransferInitializing in interface TransferListenerParameters:source - The source performing the transfer.dataSpec - Describes the data for which the transfer is initialized.isNetwork - Whether the data is transferred through a network.

- 

onTransferStart

public void onTransferStart​([DataSource](../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                            boolean isNetwork)

Description copied from interface: TransferListener

Called when a transfer starts. Specified by:onTransferStart in interface TransferListenerParameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.

- 

onBytesTransferred

public void onBytesTransferred​([DataSource](../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                               boolean isNetwork,
                               int bytesTransferred)

Description copied from interface: TransferListener

Called incrementally during a transfer. Specified by:onBytesTransferred in interface TransferListenerParameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.bytesTransferred - The number of bytes transferred since the previous call to this method.

- 

onTransferEnd

public void onTransferEnd​([DataSource](../upstream/DataSource.html "interface in com.google.android.exoplayer2.upstream")source,[DataSpec](../upstream/DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                          boolean isNetwork)

Description copied from interface: TransferListener

Called when a transfer ends. Specified by:onTransferEnd in interface TransferListenerParameters:source - The source performing the transfer.dataSpec - Describes the data being transferred.isNetwork - Whether the data is transferred through a network.