Class DataSourceException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.google.android.exoplayer2.upstream.DataSourceException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AssetDataSource.AssetDataSourceException
,ContentDataSource.ContentDataSourceException
,FileDataSource.FileDataSourceException
,HttpDataSource.HttpDataSourceException
,RawResourceDataSource.RawResourceDataSourceException
,UdpDataSource.UdpDataSourceException
@Deprecated public class DataSourceException extends IOException
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Used to specify reason of a DataSource error.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
POSITION_OUT_OF_RANGE
Deprecated.@com.google.android.exoplayer2.PlaybackException.ErrorCode int
reason
Deprecated.The reason of thisDataSourceException
, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
Constructor Summary
Constructors Constructor Description DataSourceException(@com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.DataSourceException(String message, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.DataSourceException(String message, Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.DataSourceException(Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
isCausedByPositionOutOfRange(IOException e)
Deprecated.Returns whether the givenIOException
was caused by aDataSourceException
whosereason
isPlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
in its cause stack.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
POSITION_OUT_OF_RANGE
@Deprecated public static final int POSITION_OUT_OF_RANGE
Deprecated.Indicates that thestarting position
of the request was outside the bounds of the data.- See Also:
- Constant Field Values
-
reason
@ErrorCode public final @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason
Deprecated.The reason of thisDataSourceException
, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
-
Constructor Detail
-
DataSourceException
public DataSourceException(@ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.- Parameters:
reason
- Reason of the error, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
DataSourceException
public DataSourceException(@Nullable Throwable cause, @ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.- Parameters:
cause
- The error cause.reason
- Reason of the error, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
DataSourceException
public DataSourceException(@Nullable String message, @ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.- Parameters:
message
- The error message.reason
- Reason of the error, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
DataSourceException
public DataSourceException(@Nullable String message, @Nullable Throwable cause, @ErrorCode @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Deprecated.Constructs a DataSourceException.- Parameters:
message
- The error message.cause
- The error cause.reason
- Reason of the error, should be one of theERROR_CODE_IO_*
inPlaybackException.ErrorCode
.
-
-
Method Detail
-
isCausedByPositionOutOfRange
public static boolean isCausedByPositionOutOfRange(IOException e)
Deprecated.Returns whether the givenIOException
was caused by aDataSourceException
whosereason
isPlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
in its cause stack.
-
-