Here you can find the source of loadAsset(Context context, String asset)
public static byte[] loadAsset(Context context, String asset)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.util.Log; import java.io.IOException; import java.io.InputStream; public class Main { private static final String TAG = "FeedMe"; public static byte[] loadAsset(Context context, String asset) { byte[] buffer = null; try {//from w ww . j a v a 2s .co m InputStream is = context.getAssets().open(asset); int size = is.available(); buffer = new byte[size]; is.read(buffer); is.close(); } catch (IOException e) { Log.e(TAG, "Failed to load asset " + asset + ": " + e); } return buffer; } }