title: Not able to convert image from url into byte array
body: <p>I am new to android and I need to save image from url into db and fetch it from db. I an converting image from link into byte array but getting the following error: </p>
  
  <blockquote>
    <p>Cannot Resolve ByteArrayBuffer</p>
  </blockquote>
  
  <p><strong>This is the code:</strong></p>
  
  <pre><code> private byte[] getLogoImage(String url){
      try {
               URL imageUrl = new URL(url);
               URLConnection ucon = imageUrl.openConnection();
  
               InputStream is = ucon.getInputStream();
               BufferedInputStream bis = new BufferedInputStream(is);
  
               ByteArrayBuffer baf = new ByteArrayBuffer(500);
               int current = 0;
               while ((current = bis.read()) != -1) {
                       baf.append((byte) current);
               }
  
               return baf.toByteArray();
       } catch (Exception e) {
               Log.d("ImageManager", "Error: " + e.toString());
       }
       return null;
  }
  </code></pre>