Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: base/android/java/src/org/chromium/base/FileUtils.java

Issue 2845773004: DO NOT SUBMIT: add main dex list check to classloader. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/android/java/src/org/chromium/base/Reflect.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/FileUtils.java
diff --git a/base/android/java/src/org/chromium/base/FileUtils.java b/base/android/java/src/org/chromium/base/FileUtils.java
index 931b0c4ace2cb8c99fcb01dbb6a850cd20c9fdd7..0f83d6c3e63cee12b195ea4f16db353a077101ea 100644
--- a/base/android/java/src/org/chromium/base/FileUtils.java
+++ b/base/android/java/src/org/chromium/base/FileUtils.java
@@ -8,10 +8,12 @@ import android.content.Context;
import android.net.Uri;
import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.List;
@@ -110,4 +112,20 @@ public class FileUtils {
return uri;
}
+
+ public static String extractAsset(String assetName) {
+ StringBuilder buf = new StringBuilder();
+ try {
+ InputStream is = ContextUtils.getApplicationContext().getAssets().open(assetName);
+ BufferedReader in = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ String str;
+ while ((str = in.readLine()) != null) {
+ buf.append(str);
+ }
+ in.close();
+ return buf.toString();
+ } catch (IOException e) {
+ }
+ return "";
+ }
}
« no previous file with comments | « base/BUILD.gn ('k') | base/android/java/src/org/chromium/base/Reflect.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698