Package com.google.android.exoplayer2.testutil

## Class DataSourceContractTest.FakeTransferListener

- java.lang.Object
- - com.google.android.exoplayer2.testutil.DataSourceContractTest.FakeTransferListener

- All Implemented Interfaces:
    `TransferListener`
  Enclosing class:
    DataSourceContractTest

      public static class DataSourceContractTest.FakeTransferListener
      extends Object
      implements TransferListener

  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 source,
                                             DataSpec dataSpec,
                                             boolean isNetwork)

      Description copied from interface: `TransferListener`
      Called when a transfer is being initialized.
      Specified by:
        `onTransferInitializing` in interface `TransferListener`
      Parameters:
        `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 source,
                                      DataSpec dataSpec,
                                      boolean isNetwork)

      Description copied from interface: `TransferListener`
      Called when a transfer starts.
      Specified by:
        `onTransferStart` in interface `TransferListener`
      Parameters:
        `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 source,
                                         DataSpec dataSpec,
                                         boolean isNetwork,
                                         int bytesTransferred)

      Description copied from interface: `TransferListener`
      Called incrementally during a transfer.
      Specified by:
        `onBytesTransferred` in interface `TransferListener`
      Parameters:
        `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 source,
                                    DataSpec dataSpec,
                                    boolean isNetwork)

      Description copied from interface: `TransferListener`
      Called when a transfer ends.
      Specified by:
        `onTransferEnd` in interface `TransferListener`
      Parameters:
        `source` - The source performing the transfer.
        `dataSpec` - Describes the data being transferred.
        `isNetwork` - Whether the data is transferred through a network.