title: How to Convert byte[] to Uri Image
body: <p>I save the image uri by using below code</p>
  
  <pre><code> public void insert (Uri image) throws SQLiteException {
          SQLiteDatabase database = mdb.getWritableDatabase();
          ContentValues cv = new ContentValues();
          try {
              InputStream iStream = getContentResolver().openInputStream(image);
              byte[] inputData = com.example.tony.monthlyexpenses.Utils.getBytes(iStream);
              cv.put(MyDatabaseHelper.KEY_IMAGE,inputData);
          }catch(IOException ioe)
          {
              Log.e("A", "&lt;saveImageInDB&gt; Error : " + ioe.getLocalizedMessage());
          }
          database.insert(MyDatabaseHelper.TABLE_EXPENSES, null, cv);
          database.close();
      }
  </code></pre>
  
  <p><strong>Utils</strong></p>
  
  <pre><code>    public static Bitmap getImage(byte[] image) {
              return BitmapFactory.decodeByteArray(image, 0, image.length);
          }
  
   public static byte[] getBytes(InputStream inputStream) throws IOException {
          ByteArrayOutputStream byteBuffer = new ByteArrayOutputStream();
          int bufferSize = 1024;
          byte[] buffer = new byte[bufferSize];
  
          int len = 0;
          while ((len = inputStream.read(buffer)) != -1) {
              byteBuffer.write(buffer, 0, len);
          }
          return byteBuffer.toByteArray();
      }
  </code></pre>
  
  <p>Now I want to retrieve the image and display as setImage <code>Uri</code> instead of setImage 'Bitmap'.</p>
  
  <pre><code> byte[] bb = cursor.getBlob(cursor.getColumnIndex("ImageReceipt"));
   imageView.setImageBitmap(Utils.getImage(bb));
  </code></pre>