Back to project page swipemenu.
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.
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(); } }