Back to project page fun-gl.
The source code is released under:
Apache License
If you think the Android project fun-gl listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jcxavier.android.opengl.file; //www.j ava 2s .c o m import android.content.res.AssetManager; import java.io.IOException; import java.io.InputStream; /** * Created on 12/03/2014. * * @author Joo Xavier <jcxavier@jcxavier.com> */ public final class FileManager { private static FileManager sFileManager = null; private AssetManager mAssetManager; private FileManager() { } public static FileManager getInstance() { if (sFileManager == null) { sFileManager = new FileManager(); } return sFileManager; } public void setAssetManager(final AssetManager assetManager) { mAssetManager = assetManager; } public InputStream readFile(final String filename) throws IOException { if (mAssetManager == null) { throw new IllegalStateException("There is no valid asset manager from where to read the file."); } return mAssetManager.open(filename); } }