Code example for AssetFileDescriptor

Methods: createInputStream

0
		    			null);*/ 
				Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, Long.parseLong(datasourceid));
				Uri displayPhotoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO);
				try { 
					AssetFileDescriptor fd = contentResolver.openAssetFileDescriptor(displayPhotoUri, "r");
					InputStream is = fd.createInputStream();
					BufferedInputStream bis = new BufferedInputStream(is);
		   			bm = BitmapFactory.decodeStream(new FlushedInputStream(is));
				} catch (IOException e) {
					status = 0;
				} 
	   			 
	   			//portrait = IOUtils.toByteArray(fd.createInputStream()); 
				/* 
				if (data.getCount() > 0) { 
			   		while(data.moveToNext()) { 
			   			 
			   			//portrait = data.getBlob(data.getColumnIndex(Photo.PHOTO)); 
			   			if (portrait != null) 
			   				break; 
			   		}