load Jpg Stream From Assets - Android Graphics

Android examples for Graphics:JPEG Image

Description

load Jpg Stream From Assets

Demo Code


//package com.java2s;
import android.content.Context;

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

public class Main {
    public static final String JPG_EXTENSION = ".jpg";

    public static InputStream loadJpgStreamFromAssets(Context context,
            String imageFile) throws IOException {
        InputStream inputStream = null;
        inputStream = context.getAssets().open(imageFile + JPG_EXTENSION);
        return inputStream;
    }//from  ww  w. j  av a  2  s.c  o m
}

Related Tutorials