Interface BandwidthMeter
-
- All Known Implementing Classes:
DefaultBandwidthMeter
public interface BandwidthMeter
Provides estimates of the currently available bandwidth.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
BandwidthMeter.EventListener
A listener ofBandwidthMeter
events.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addEventListener(Handler eventHandler, BandwidthMeter.EventListener eventListener)
Adds anBandwidthMeter.EventListener
.long
getBitrateEstimate()
Returns the estimated bitrate.default long
getTimeToFirstByteEstimateUs()
Returns the estimated time to first byte, in microseconds, orC.TIME_UNSET
if no estimate is available.TransferListener
getTransferListener()
Returns theTransferListener
that this instance uses to gather bandwidth information from data transfers.void
removeEventListener(BandwidthMeter.EventListener eventListener)
Removes anBandwidthMeter.EventListener
.
-
-
-
Method Detail
-
getBitrateEstimate
long getBitrateEstimate()
Returns the estimated bitrate.
-
getTimeToFirstByteEstimateUs
default long getTimeToFirstByteEstimateUs()
Returns the estimated time to first byte, in microseconds, orC.TIME_UNSET
if no estimate is available.
-
getTransferListener
@Nullable TransferListener getTransferListener()
Returns theTransferListener
that this instance uses to gather bandwidth information from data transfers. May be null if the implementation does not listen to data transfers.
-
addEventListener
void addEventListener(Handler eventHandler, BandwidthMeter.EventListener eventListener)
Adds anBandwidthMeter.EventListener
.- Parameters:
eventHandler
- A handler for events.eventListener
- A listener of events.
-
removeEventListener
void removeEventListener(BandwidthMeter.EventListener eventListener)
Removes anBandwidthMeter.EventListener
.- Parameters:
eventListener
- The listener to be removed.
-
-