title: How to convert byte array to image [kotlin]
body: <p>I want to convert byte array to image and show it in image view, but not sure how to do it. Can someone guide me please</p>
  <p>I use this function to convert bitmap to byte array</p>
  <pre><code>private fun BitmapToByteArray(): ByteArray
      {
          val stream = ByteArrayOutputStream()
          btm1!!.compress(Bitmap.CompressFormat.PNG, 100, stream)
          val bitmapdata: ByteArray = stream.toByteArray()
          return bitmapdata
      }
  </code></pre>