Code example for FileChannel

Methods: size, transferTo

0
    	catch(Exception e)
    	{ 
    		System.out.println("ERROR: " + e.getMessage());
    		Log.e(TAG, e.getClass().getName());
    	} 
    } 
     
     
    static public Bitmap getBitmapFromFile(String file, int height, boolean crop) {
    	Options opt = new Options();
		opt.inSampleSize = 2;
		Bitmap bm = BitmapFactory.decodeFile(file, opt);
		int width = height;
		if (!crop) {
			width = (height * bm.getWidth()) / bm.getHeight();
		} 
    	return ThumbnailUtils.extractThumbnail(bm, width, height);
    } 
     
	static public Bitmap getBitmapFromFileNormal(String file, int height, boolean crop) {
		try {