title: Printing an InputStream in Logcat
body: <p>I want to print the InputStream in logcat(for testing/later I will use it), my current code is as follows.</p>
  
  <pre><code>        @Override
          protected Void doInBackground(Void... params) {
  
              try {
  
                  InputStream in = null;
                  int response = -1;
  
                  URL url = new URL(
                          "http://any-website.com/search/users/sports+persons");
                  URLConnection conn = null;
                  HttpURLConnection httpConn = null;
                  conn = url.openConnection();
  
                  if (!(conn instanceof HttpURLConnection))
                      throw new IOException("Not an HTTP connection");
  
                  httpConn = (HttpURLConnection) conn;
                  httpConn.setAllowUserInteraction(false);
                  httpConn.setInstanceFollowRedirects(true);
                  httpConn.setRequestMethod("GET");
                  httpConn.connect();
  
                  response = httpConn.getResponseCode();
                  if (response == HttpURLConnection.HTTP_OK) {
                      in = httpConn.getInputStream();
                  }
  
                  if (in != null) {
                      Log.e(TAG, "&gt;&gt;&gt;&gt;&gt;PRINTING&lt;&lt;&lt;&lt;&lt;");
                      Log.e(TAG, in.toString());
                     // TODO: print 'in' from here
                  }
                  in.close();
                  in = null;
  
  
  
              } catch (Exception e) {
                  e.printStackTrace();
              }
  
              return null;
          }
  </code></pre>
  
  <p>But I am not able to do this, so please check the code and add/modify the code to do this.</p>