DataReader
@UnstableApi
public interface DataReader
DataSource |
Reads data from URI-identified resources. |
ExtractorInput |
Provides data to be consumed by an |
AesCipherDataSource |
A |
AssetDataSource |
A |
BaseDataSource |
Base |
ByteArrayDataSource |
A |
CacheDataSource |
A |
ContentDataSource |
A |
CronetDataSource |
DataSource without intermediate buffer based on Cronet API set using UrlRequest. |
DataSchemeDataSource |
A |
DefaultDataSource |
A |
DefaultExtractorInput |
An |
DefaultHttpDataSource |
An |
FakeDataSource |
A fake |
FakeExtractorInput |
A fake |
FileDataSource |
A |
FileDescriptorDataSource |
A |
ForwardingExtractorInput |
An overridable |
HttpDataSource |
An HTTP |
HttpEngineDataSource |
DataSource without intermediate buffer based on |
MediaDataSourceAdapter |
A |
OkHttpDataSource |
An |
PlaceholderDataSource |
A DataSource which provides no data. |
PriorityDataSource |
A |
RawResourceDataSource |
A |
ResolvingDataSource |
|
RtmpDataSource |
A Real-Time Messaging Protocol (RTMP) |
StatsDataSource |
|
TeeDataSource |
Tees data into a |
UdpDataSource |
A UDP |
Reads bytes from a data stream.
Summary
Public methods |
|
|---|---|
abstract int |
read(byte[] buffer, int offset, int length)Reads up to |
Public methods
read
abstract int read(byte[] buffer, int offset, int length)
Reads up to length bytes of data from the input.
If readLength is zero then 0 is returned. Otherwise, if no data is available because the end of the opened range has been reached, then RESULT_END_OF_INPUT is returned. Otherwise, the call will block until at least one byte of data has been read and the number of bytes read is returned.
| Parameters | |
|---|---|
byte[] buffer |
A target array into which data should be written. |
int offset |
The offset into the target array at which to write. |
int length |
The maximum number of bytes to read from the input. |
| Returns | |
|---|---|
int |
The number of bytes read, or |
| Throws | |
|---|---|
java.io.IOException |
If an error occurs reading from the input. |