mirror of https://github.com/FongMi/TV.git
parent
980e7a535f
commit
6400ddb8b3
@ -0,0 +1,24 @@ |
||||
package com.github.catvod.utils; |
||||
|
||||
import com.github.catvod.Init; |
||||
|
||||
import java.io.InputStream; |
||||
|
||||
public class Asset { |
||||
|
||||
public static InputStream open(String fileName) { |
||||
try { |
||||
return Init.context().getAssets().open(fileName.replace("assets://", "")); |
||||
} catch (Exception e) { |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
public static String read(String fileName) { |
||||
try { |
||||
return Path.read(open(fileName)); |
||||
} catch (Exception e) { |
||||
return ""; |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue