docs/doc/reference/com/google/android/exoplayer2/upstream/DataReader.html
Package com.google.android.exoplayer2.upstream
DataSource, ExtractorInput, HttpDataSourceAll Known Implementing Classes:AesCipherDataSource, AssetDataSource, BaseDataSource, ByteArrayDataSource, CacheDataSource, ContentDataSource, CronetDataSource, DataSchemeDataSource, DefaultDataSource, DefaultExtractorInput, DefaultHttpDataSource, FakeDataSource, FakeExtractorInput, FileDataSource, ForwardingExtractorInput, OkHttpDataSource, PlaceholderDataSource, PriorityDataSource, RawResourceDataSource, ResolvingDataSource, RtmpDataSource, StatsDataSource, TeeDataSource, UdpDataSource[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceDataReader
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.
Reads bytes from a data stream.
All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| int | read(byte[] buffer, int offset, int length) |
Deprecated.
Reads up to length bytes of data from the input.
|
-
int read(byte[] buffer,
int offset,
int length)
throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")
Deprecated.
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 C.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:buffer - A target array into which data should be written.offset - The offset into the target array at which to write.length - The maximum number of bytes to read from the input.Returns:The number of bytes read, or C.RESULT_END_OF_INPUT if the input has ended. This may be less than length because the end of the input (or available data) was reached, the method was interrupted, or the operation was aborted early for another reason.Throws:IOException - If an error occurs reading from the input.