title: Grails controller: how render image from byte array
body: <p>I have byte array byteImg but I want render in my controller jpeg from byte array:</p>
  
  <pre><code>    def getSelfie = new HTTPBuilder()
      getSelfie.request(fullSelfieUrl, GET, JSON) { req -&gt;
          headers.'X-DreamFactory-Session-Token' = session_id
          headers.'X-DreamFactory-Application-Name' = 'checkReg'
          response.success = { resp, reader -&gt;
              assert resp.statusLine.statusCode == 200
              println "Get response: ${resp.statusLine}"
              println "Content-Type: ${resp.headers.'Content-Type'}"
              resp = reader as grails.converters.JSON
  
              String str = resp.toString()
              JSONObject jsonObject = new JSONObject(str)
              selfieRend = jsonObject.getString("selfie")
              byteImg = selfieRend.getBytes()
  
              render byteImg
              return byteImg
          }
          response.'404' = {
              println 'Information not found'
          }
      }
  </code></pre>
  
  <p>how to do it? Thank you so much</p>