DataSourceInputStream
@UnstableApi
class DataSourceInputStream : InputStream
Allows data corresponding to a given DataSpec
to be read from a DataSource
and consumed through an InputStream
.
Summary
Public constructors |
---|
DataSourceInputStream(dataSource: DataSource!, dataSpec: DataSpec!) |
Public functions |
|
---|---|
Long |
Returns the total number of bytes that have been read or skipped. |
Unit |
close() |
Unit |
open() Optional call to open the underlying |
Int |
read() |
Int |
|
Int |
Inherited functions |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
DataSourceInputStream
DataSourceInputStream(dataSource: DataSource!, dataSpec: DataSpec!)
Parameters | |
---|---|
dataSource: DataSource! |
The |
dataSpec: DataSpec! |
The |
Public functions
open
fun open(): Unit
Optional call to open the underlying DataSource
.
Calling this method does nothing if the DataSource
is already open. Calling this method is optional, since the read and skip methods will automatically open the underlying DataSource
if it's not open already.
Throws | |
---|---|
java.io.IOException |
If an error occurs opening the |