Package com.google.android.exoplayer2.upstream

## 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 of `BandwidthMeter` events.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addEventListener​(Handler eventHandler, BandwidthMeter.EventListener eventListener)` | Adds an `BandwidthMeter.EventListener`.
    `long` | `getBitrateEstimate()` | Returns the estimated bitrate.
    `default long` | `getTimeToFirstByteEstimateUs()` | Returns the estimated time to first byte, in microseconds, or `C.TIME_UNSET` if no estimate is available.
    `TransferListener` | `getTransferListener()` | Returns the `TransferListener` that this instance uses to gather bandwidth information from data transfers.
    `void` | `removeEventListener​(BandwidthMeter.EventListener eventListener)` | Removes an `BandwidthMeter.EventListener`.

- - ### Method Detail

    - #### getBitrateEstimate

          long getBitrateEstimate()

      Returns the estimated bitrate.

    - #### getTimeToFirstByteEstimateUs

          default long getTimeToFirstByteEstimateUs()

      Returns the estimated time to first byte, in microseconds, or `C.TIME_UNSET` if no estimate is available.

    - #### getTransferListener

          @Nullable
          TransferListener getTransferListener()

      Returns the `TransferListener` 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 an `BandwidthMeter.EventListener`.
      Parameters:
        `eventHandler` - A handler for events.
        `eventListener` - A listener of events.

    - #### removeEventListener

          void removeEventListener​(BandwidthMeter.EventListener eventListener)

      Removes an `BandwidthMeter.EventListener`.
      Parameters:
        `eventListener` - The listener to be removed.