SplitParallelSampleBandwidthEstimator


@UnstableApi
class SplitParallelSampleBandwidthEstimator : BandwidthEstimator


A BandwidthEstimator that captures a transfer sample each time a transfer ends. When parallel transfers are happening at the same time, the transferred bytes are aggregated in a single sample.

Summary

Public functions

Unit
addEventListener(
    eventHandler: Handler!,
    eventListener: BandwidthMeter.EventListener!
)

Adds an BandwidthMeter.EventListener.

Unit
onBytesTransferred(source: DataSource!, bytesTransferred: Int)

Called incrementally during a transfer.

Unit
onNetworkTypeChange(newBandwidthEstimate: Long)

Notifies this estimator that a network change has been detected.

Unit

Called when a transfer ends.

Unit

Called when a transfer is being initialized.

Unit

Called when a transfer starts.

Unit

Removes an BandwidthMeter.EventListener.

Public properties

Long

Public functions

addEventListener

fun addEventListener(
    eventHandler: Handler!,
    eventListener: BandwidthMeter.EventListener!
): Unit

Adds an BandwidthMeter.EventListener.

Parameters
eventHandler: Handler!

A handler for events.

eventListener: BandwidthMeter.EventListener!

A listener of events.

onBytesTransferred

fun onBytesTransferred(source: DataSource!, bytesTransferred: Int): Unit

Called incrementally during a transfer.

Parameters
source: DataSource!

The DataSource performing the transfer.

bytesTransferred: Int

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

onNetworkTypeChange

fun onNetworkTypeChange(newBandwidthEstimate: Long): Unit

Notifies this estimator that a network change has been detected.

Parameters
newBandwidthEstimate: Long

The new initial bandwidth estimate based on network type.

onTransferEnd

fun onTransferEnd(source: DataSource!): Unit

Called when a transfer ends.

Parameters
source: DataSource!

The DataSource performing the transfer.

onTransferInitializing

fun onTransferInitializing(source: DataSource!): Unit

Called when a transfer is being initialized.

Parameters
source: DataSource!

The DataSource performing the transfer.

onTransferStart

fun onTransferStart(source: DataSource!): Unit

Called when a transfer starts.

Parameters
source: DataSource!

The DataSource performing the transfer.

removeEventListener

fun removeEventListener(eventListener: BandwidthMeter.EventListener!): Unit

Removes an BandwidthMeter.EventListener.

Parameters
eventListener: BandwidthMeter.EventListener!

The listener to be removed.

Public properties

bandwidthEstimate

val bandwidthEstimateLong