Android Open Source - swipemenu Raw Resource Reader






From Project

Back to project page swipemenu.

License

The source code is released under:

Apache License

If you think the Android project swipemenu listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.orhanobut.android.swipemenu;
/*from  w w  w . j  a v a2s .  c o  m*/
import android.content.Context;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class RawResourceReader {
    public static String readTextFileFromRawResource(Context context, int resourceId) {

        InputStream inputStream = context.getResources().openRawResource(
                resourceId);
        InputStreamReader inputStreamReader = new InputStreamReader(
                inputStream);
        BufferedReader bufferedReader = new BufferedReader(
                inputStreamReader);

        String nextLine;
        StringBuilder body = new StringBuilder();

        try {
            while ((nextLine = bufferedReader.readLine()) != null) {
                body.append(nextLine);
                body.append('\n');
            }
        } catch (IOException e) {
            return null;
        }

        return body.toString();
    }
}




Java Source Code List

com.orhanobut.android.swipemenu.MainActivity.java
com.orhanobut.android.swipemenu.MainCircle.java
com.orhanobut.android.swipemenu.MyGLSurfaceView.java
com.orhanobut.android.swipemenu.MyRenderer.java
com.orhanobut.android.swipemenu.RawResourceReader.java
com.orhanobut.android.swipemenu.ShaderHelper.java
com.orhanobut.android.swipemenu.ShapeActivity.java
com.orhanobut.android.swipemenu.Square.java
com.orhanobut.android.swipemenu.TextureActivity.java
com.orhanobut.android.swipemenu.TextureHelper.java
com.orhanobut.android.swipemenu.TextureRenderer.java
com.orhanobut.android.swipemenu.WorldObject.java