Back to Exoplayer

HttpDataSource.HttpDataSourceException (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/HttpDataSource.HttpDataSourceException.html

latest17.4 KB
Original Source

Package com.google.android.exoplayer2.upstream

Class HttpDataSource.HttpDataSourceException


public static classHttpDataSource.HttpDataSourceExceptionextends[DataSourceException](DataSourceException.html "class in com.google.android.exoplayer2.upstream")

Thrown when an error is encountered when trying to read from a HttpDataSource. See Also:Serialized Form

Nested Class Summary

Nested Classes | Modifier and Type | Class | Description | | --- | --- | --- | | static interface | HttpDataSource.HttpDataSourceException.Type | The type of operation that produced the error. |

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | DataSpec | dataSpec | The DataSpec associated with the current connection. | | @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int | type | | | static int | TYPE_CLOSE | The error occurred in closing a HttpDataSource. | | static int | TYPE_OPEN | The error occurred reading data from a HttpDataSource. | | static int | TYPE_READ | The error occurred in opening a HttpDataSource. |

- 

Fields inherited from class com.google.android.exoplayer2.upstream.DataSourceException

POSITION_OUT_OF_RANGE, reason

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | HttpDataSourceException​(DataSpec dataSpec, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Constructs an HttpDataSourceException. | | HttpDataSourceException​(DataSpec dataSpec, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Deprecated. Use HttpDataSourceException(DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

| | HttpDataSourceException​(IOException cause, DataSpec dataSpec, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Constructs an HttpDataSourceException. | | HttpDataSourceException​(IOException cause, DataSpec dataSpec, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Deprecated. Use HttpDataSourceException(IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

| | HttpDataSourceException​(String message, DataSpec dataSpec, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Constructs an HttpDataSourceException. | | HttpDataSourceException​(String message, DataSpec dataSpec, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Deprecated. Use HttpDataSourceException(String, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

| | HttpDataSourceException​(String message, IOException cause, DataSpec dataSpec, @com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Constructs an HttpDataSourceException. | | HttpDataSourceException​(String message, IOException cause, DataSpec dataSpec, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Deprecated. Use HttpDataSourceException(String, IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

|

Method Summary

All Methods Static Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | static HttpDataSource.HttpDataSourceException | createForIOException​(IOException cause, DataSpec dataSpec, @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type) | Returns a HttpDataSourceException whose error code is assigned according to the cause and type. |

- 

Methods inherited from class com.google.android.exoplayer2.upstream.DataSourceException

isCausedByPositionOutOfRange

- 

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

- 

TYPE_OPEN

public static final int TYPE_OPEN

The error occurred reading data from a HttpDataSource. See Also:Constant Field Values

- 

TYPE_READ

public static final int TYPE_READ

The error occurred in opening a HttpDataSource. See Also:Constant Field Values

- 

TYPE_CLOSE

public static final int TYPE_CLOSE

The error occurred in closing a HttpDataSource. See Also:Constant Field Values

- 

dataSpec

public final[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec

The DataSpec associated with the current connection.

- 

type

public final @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type

Constructor Detail

- 

HttpDataSourceException

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public HttpDataSourceException​([DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Deprecated. Use HttpDataSourceException(DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

- 

HttpDataSourceException

public HttpDataSourceException​([DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Constructs an HttpDataSourceException. Parameters:dataSpec - The DataSpec.errorCode - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.type - See HttpDataSource.HttpDataSourceException.Type.

- 

HttpDataSourceException

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public HttpDataSourceException​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Deprecated. Use HttpDataSourceException(String, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

- 

HttpDataSourceException

public HttpDataSourceException​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Constructs an HttpDataSourceException. Parameters:message - The error message.dataSpec - The DataSpec.errorCode - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.type - See HttpDataSource.HttpDataSourceException.Type.

- 

HttpDataSourceException

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public HttpDataSourceException​([IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")cause,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Deprecated. Use HttpDataSourceException(IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

- 

HttpDataSourceException

public HttpDataSourceException​([IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")cause,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Constructs an HttpDataSourceException. Parameters:cause - The error cause.dataSpec - The DataSpec.errorCode - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.type - See HttpDataSource.HttpDataSourceException.Type.

- 

HttpDataSourceException

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public HttpDataSourceException​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")cause,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Deprecated. Use HttpDataSourceException(String, IOException, DataSpec, PlaybackException.ERROR_CODE_IO_UNSPECIFIED, int).

- 

HttpDataSourceException

public HttpDataSourceException​([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")message,
                               @Nullable[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")cause,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,[@ErrorCode](../PlaybackException.ErrorCode.html "annotation in com.google.android.exoplayer2")@com.google.android.exoplayer2.PlaybackException.ErrorCode int errorCode,
                               @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Constructs an HttpDataSourceException. Parameters:message - The error message.cause - The error cause.dataSpec - The DataSpec.errorCode - Reason of the error, should be one of the ERROR_CODE_IO_* in PlaybackException.ErrorCode.type - See HttpDataSource.HttpDataSourceException.Type.

Method Detail

- 

createForIOException

public static[HttpDataSource.HttpDataSourceException](HttpDataSource.HttpDataSourceException.html "class in com.google.android.exoplayer2.upstream")createForIOException​([IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")cause,[DataSpec](DataSpec.html "class in com.google.android.exoplayer2.upstream")dataSpec,
                                                                          @com.google.android.exoplayer2.upstream.HttpDataSource.HttpDataSourceException.Type int type)

Returns a HttpDataSourceException whose error code is assigned according to the cause and type.