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
public class DataSourceException extends IOException
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
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)
Constructs a DataSourceException.DataSourceException(String message, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Constructs a DataSourceException.DataSourceException(String message, Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Constructs a DataSourceException.DataSourceException(Throwable cause, @com.google.android.exoplayer2.PlaybackException.ErrorCode int reason)
Constructs a DataSourceException.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isCausedByPositionOutOfRange(IOException e)
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
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)
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)
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)
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)
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)
Returns whether the givenIOException
was caused by aDataSourceException
whosereason
isPlaybackException.ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE
in its cause stack.
-
-