public final class DataSpec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
long |
absoluteStreamPosition
The absolute position of the data in the full stream.
|
static int |
FLAG_ALLOW_GZIP
Permits an underlying network stack to request that the server use gzip compression.
|
int |
flags
Request flags.
|
java.lang.String |
key
A key that uniquely identifies the original stream.
|
long |
length
The length of the data.
|
long |
position
The position of the data when read from
uri . |
byte[] |
postBody
Body for a POST request, null otherwise.
|
android.net.Uri |
uri
Identifies the source from which data should be read.
|
Constructor and Description |
---|
DataSpec(android.net.Uri uri)
|
DataSpec(android.net.Uri uri,
byte[] postBody,
long absoluteStreamPosition,
long position,
long length,
java.lang.String key,
int flags)
|
DataSpec(android.net.Uri uri,
int flags)
|
DataSpec(android.net.Uri uri,
long absoluteStreamPosition,
long position,
long length,
java.lang.String key,
int flags)
|
DataSpec(android.net.Uri uri,
long absoluteStreamPosition,
long length,
java.lang.String key)
|
DataSpec(android.net.Uri uri,
long absoluteStreamPosition,
long length,
java.lang.String key,
int flags)
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
toString() |
public static final int FLAG_ALLOW_GZIP
Should not typically be set if the data being requested is already compressed (e.g. most audio and video requests). May be set when requesting other data.
When a DataSource
is used to request data with this flag set, and if the
DataSource
does make a network request, then the value returned from
DataSource.open(DataSpec)
will typically be C.LENGTH_UNBOUNDED
. The data read
from DataSource.read(byte[], int, int)
will be the decompressed data.
public final android.net.Uri uri
public final byte[] postBody
public final long absoluteStreamPosition
public final long position
uri
.
Always equal to absoluteStreamPosition
unless the uri
defines the location
of a subset of the underyling data.
public final long length
C.LENGTH_UNBOUNDED
.public final java.lang.String key
DataSpec
is not intended to be used in conjunction with a cache.public final int flags
FLAG_ALLOW_GZIP
is the only supported flag.public DataSpec(android.net.Uri uri)
uri
- uri
.public DataSpec(android.net.Uri uri, long absoluteStreamPosition, long length, java.lang.String key)
uri
- uri
.absoluteStreamPosition
- absoluteStreamPosition
, equal to position
.length
- length
.key
- key
.public DataSpec(android.net.Uri uri, long absoluteStreamPosition, long length, java.lang.String key, int flags)
public DataSpec(android.net.Uri uri, long absoluteStreamPosition, long position, long length, java.lang.String key, int flags)
public DataSpec(android.net.Uri uri, byte[] postBody, long absoluteStreamPosition, long position, long length, java.lang.String key, int flags)