Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.res.AssetManager;

import java.io.IOException;
import java.io.InputStream;

public class Main {
    private static Context context;

    public static byte[] loadIntoBytes(String fileName) {
        AssetManager assetManager = context.getAssets();
        try {
            InputStream is = assetManager.open(fileName);
            byte buf[] = new byte[is.available()];
            is.read(buf);
            return buf;
        } catch (IOException e) {
        }
        return null;
    }
}