Package com.google.android.exoplayer2.audio

## Class AudioSink.WriteException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - com.google.android.exoplayer2.audio.AudioSink.WriteException

- All Implemented Interfaces:
    `Serializable`
  Enclosing interface:
    AudioSink

      public static final class AudioSink.WriteException
      extends Exception

  Thrown when a failure occurs writing to the sink.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `int` | `errorCode` | The error value returned from the sink implementation.
    `Format` | `format` | The input `Format` of the sink when the error occurs.
    `boolean` | `isRecoverable` | If the exception can be recovered by recreating the sink.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `WriteException​(int errorCode, Format format, boolean isRecoverable)` | Creates an instance.

  - ### Method Summary

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- - ### Field Detail

    - #### errorCode

          public final int errorCode

      The error value returned from the sink implementation. If the sink writes to a platform `AudioTrack`, this will be the error value returned from `AudioTrack.write(byte[], int, int)` or `AudioTrack.write(ByteBuffer, int, int)`. Otherwise, the meaning of the error code depends on the sink implementation.

    - #### isRecoverable

          public final boolean isRecoverable

      If the exception can be recovered by recreating the sink.

    - #### format

          public final Format format

      The input `Format` of the sink when the error occurs.

  - ### Constructor Detail

    - #### WriteException

          public WriteException​(int errorCode,
                                Format format,
                                boolean isRecoverable)

      Creates an instance.
      Parameters:
        `errorCode` - The error value returned from the sink implementation.
        `format` - The input format of the sink when the error occurs.
        `isRecoverable` - Whether the exception can be recovered by recreating the sink.