Package com.google.android.exoplayer2.testutil

## Class FailOnCloseDataSink.Factory

- java.lang.Object
- - com.google.android.exoplayer2.testutil.FailOnCloseDataSink.Factory

- All Implemented Interfaces:
    `DataSink.Factory`
  Enclosing class:
    FailOnCloseDataSink

      public static final class FailOnCloseDataSink.Factory
      extends Object
      implements DataSink.Factory

  Factory to create a `FailOnCloseDataSink`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Factory​(Cache cache, AtomicBoolean failOnClose)` | Creates an instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `DataSink` | `createDataSink()` | Creates a `DataSink` instance.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Factory

          public Factory​(Cache cache,
                         AtomicBoolean failOnClose)

      Creates an instance.
      Parameters:
        `cache` - The cache to write to when not in fail-on-close mode.
        `failOnClose` - An `AtomicBoolean` whose value is read in each call to `DataSink.open(com.google.android.exoplayer2.upstream.DataSpec)` to determine whether to enable fail-on-close for the read that's being started.

  - ### Method Detail

    - #### createDataSink

          public DataSink createDataSink()

      Description copied from interface: `DataSink.Factory`
      Creates a `DataSink` instance.
      Specified by:
        `createDataSink` in interface `DataSink.Factory`