Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

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

import android.content.res.AssetManager;

public class Main {
    public static String readAsset(AssetManager assets, String path) throws IOException {
        InputStream is = assets.open(path);
        int size = is.available();
        byte[] buffer = new byte[size];
        is.read(buffer);
        is.close();
        return new String(buffer);
    }
}