Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c34f7368
authored
Oct 28, 2014
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Minor tweak to UriDataSource.
parent
b5c4148f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
library/src/main/java/com/google/android/exoplayer/upstream/UriDataSource.java
library/src/main/java/com/google/android/exoplayer/upstream/UriDataSource.java
View file @
c34f7368
...
...
@@ -62,24 +62,21 @@ public final class UriDataSource implements DataSource {
@Override
public
long
open
(
DataSpec
dataSpec
)
throws
IOException
{
Assertions
.
checkState
(
dataSource
==
null
);
dataSource
=
dataSpec
.
uri
.
getScheme
().
equals
(
FILE_URI_SCHEME
)
?
fileDataSource
:
httpDataSource
;
dataSource
=
FILE_URI_SCHEME
.
equals
(
dataSpec
.
uri
.
getScheme
())
?
fileDataSource
:
httpDataSource
;
return
dataSource
.
open
(
dataSpec
);
}
@Override
public
void
close
()
throws
IOException
{
Assertions
.
checkNotNull
(
dataSource
);
dataSource
.
close
();
dataSource
=
null
;
public
int
read
(
byte
[]
buffer
,
int
offset
,
int
readLength
)
throws
IOException
{
return
dataSource
.
read
(
buffer
,
offset
,
readLength
);
}
@Override
public
int
read
(
byte
[]
buffer
,
int
offset
,
int
readLength
)
throws
IOException
{
Assertions
.
checkNotNull
(
dataSource
);
return
dataSource
.
read
(
buffer
,
offset
,
readLength
);
public
void
close
()
throws
IOException
{
if
(
dataSource
!=
null
)
{
dataSource
.
close
();
dataSource
=
null
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment