mirror of https://github.com/FongMi/TV.git
parent
4b792828dc
commit
bc964ebe6f
@ -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