Package org.robolectric.shadows.util
Class DataSource
java.lang.Object
org.robolectric.shadows.util.DataSource
public class DataSource extends Object
Opaque class for uniquely identifying a media data source, as used by
ShadowMediaPlayer
, ShadowMediaMetadataRetriever
, and ShadowMediaExtractor
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DataSource.FileDescriptorTransform
Transform aFileDescriptor
to a string. -
Method Summary
Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
static void
reset()
static void
setFileDescriptorTransform(DataSource.FileDescriptorTransform transform)
Optional transformation forFileDescriptor
.static DataSource
toDataSource(Context context, Uri uri)
static DataSource
toDataSource(Context context, Uri uri, Map<String,String> headers)
static DataSource
toDataSource(Context context, Uri uri, Map<String,String> headers, List<HttpCookie> cookies)
static DataSource
toDataSource(AssetFileDescriptor assetFileDescriptor)
static DataSource
toDataSource(MediaDataSource mediaDataSource)
static DataSource
toDataSource(FileDescriptor fd)
static DataSource
toDataSource(FileDescriptor fd, long offset, long length)
static DataSource
toDataSource(String path)
static DataSource
toDataSource(String uri, Map<String,String> headers)
-
Method Details
-
setFileDescriptorTransform
Optional transformation forFileDescriptor
.Helpful for associating a real test file to the data source used by shadow objects in stubbed methods.
-
toDataSource
-
toDataSource
-
toDataSource
-
toDataSource
public static DataSource toDataSource(Context context, Uri uri, Map<String,String> headers, List<HttpCookie> cookies) -
toDataSource
-
toDataSource
-
toDataSource
-
toDataSource
-
toDataSource
-
reset
public static void reset() -
hashCode
public int hashCode() -
equals
-