title: OutOfMemoryError while converting Stream to String in Android
body: <p>am loading xml file from Assets folder. am getting OutOfMemoryError.
  The code which i have used is </p>
  
  <pre><code>private String convertStreamToString(InputStream is) {  
      BufferedReader reader = new BufferedReader(new InputStreamReader(is));
      StringBuilder sb = new StringBuilder();
  
      String line = null;
      try {
          while ((line = reader.readLine()) != null) {
              sb.append(line + NEW_LINE);
          }
          reader.close();
  
      } catch (IOException e) {
          //do nothing.
      } finally {
          try {
              reader.close();
          } catch (IOException e) {
              //do nothing.    
          }
      }
      reader=null;
      return sb.toString();
  }
  </code></pre>
  
  <p>Is there an alternate way to get rid of this Exception.
  It will be more helpful if you post any code.
  Thanks in advance.</p>