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
001d3468
authored
Apr 12, 2023
by
sheenachhabra
Committed by
Rohit Singh
Apr 12, 2023
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove cache term from TestUtil methods
PiperOrigin-RevId: 523675327
parent
cd16da03
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java
testutils/src/main/java/com/google/android/exoplayer2/testutil/TestUtil.java
View file @
001d3468
...
@@ -190,9 +190,9 @@ public class TestUtil {
...
@@ -190,9 +190,9 @@ public class TestUtil {
return
Util
.
toByteArray
(
getInputStream
(
context
,
fileName
));
return
Util
.
toByteArray
(
getInputStream
(
context
,
fileName
));
}
}
/** Returns the bytes of a
cache
file using its file path. */
/** Returns the bytes of a file using its file path. */
public
static
byte
[]
getByteArrayFrom
Cache
(
String
cacheF
ilePath
)
throws
IOException
{
public
static
byte
[]
getByteArrayFrom
FilePath
(
String
f
ilePath
)
throws
IOException
{
InputStream
inputStream
=
new
FileInputStream
(
cacheF
ilePath
);
InputStream
inputStream
=
new
FileInputStream
(
f
ilePath
);
return
Util
.
toByteArray
(
inputStream
);
return
Util
.
toByteArray
(
inputStream
);
}
}
...
@@ -400,7 +400,7 @@ public class TestUtil {
...
@@ -400,7 +400,7 @@ public class TestUtil {
/**
/**
* Extracts all samples from the given file into a {@link FakeTrackOutput}.
* Extracts all samples from the given file into a {@link FakeTrackOutput}.
*
*
* @param extractor The {@link Extractor} to
extractor from input
.
* @param extractor The {@link Extractor} to
be used
.
* @param context A {@link Context}.
* @param context A {@link Context}.
* @param fileName The name of the input file.
* @param fileName The name of the input file.
* @return The {@link FakeTrackOutput} containing the extracted samples.
* @return The {@link FakeTrackOutput} containing the extracted samples.
...
@@ -414,17 +414,17 @@ public class TestUtil {
...
@@ -414,17 +414,17 @@ public class TestUtil {
}
}
/**
/**
* Extracts all samples from the given
storage
file into a {@link FakeTrackOutput}.
* Extracts all samples from the given file into a {@link FakeTrackOutput}.
*
*
* @param extractor The {@link Extractor} to
extractor from input
.
* @param extractor The {@link Extractor} to
be used
.
* @param
cacheFilePath The cac
he file path.
* @param
filePath T
he file path.
* @return The {@link FakeTrackOutput} containing the extracted samples.
* @return The {@link FakeTrackOutput} containing the extracted samples.
* @throws IOException If an error occurred reading from the input, or if the extractor finishes
* @throws IOException If an error occurred reading from the input, or if the extractor finishes
* reading from input without extracting any {@link SeekMap}.
* reading from input without extracting any {@link SeekMap}.
*/
*/
public
static
FakeExtractorOutput
extractAllSamplesFrom
CacheFile
(
public
static
FakeExtractorOutput
extractAllSamplesFrom
FilePath
(
Extractor
extractor
,
String
cacheF
ilePath
)
throws
IOException
{
Extractor
extractor
,
String
f
ilePath
)
throws
IOException
{
byte
[]
data
=
TestUtil
.
getByteArrayFromCache
(
cacheF
ilePath
);
byte
[]
data
=
getByteArrayFromFilePath
(
f
ilePath
);
return
extractAllSamplesFromByteArray
(
extractor
,
data
);
return
extractAllSamplesFromByteArray
(
extractor
,
data
);
}
}
...
...
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