Package org.robolectric.shadows.util
Class DataSource
java.lang.Object
org.robolectric.shadows.util.DataSource
Opaque class for uniquely identifying a media data source, as used by
ShadowMediaPlayer
, ShadowMediaMetadataRetriever
, and ShadowMediaExtractor
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
static void
reset()
static void
Optional transformation forFileDescriptor
.static DataSource
toDataSource
(Context context, Uri uri) static DataSource
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
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
-