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.Context;

public class Main {
    private static Context context;

    public static byte[] suckFile(String inputfile) throws IOException {
        InputStream is = context.openFileInput(inputfile);
        int size = is.available();
        byte[] content = new byte[size];

        is.read(content);

        is.close();
        return content;
    }
}