Class DataSourceContractTest.FakeTransferListener

    • 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.