title: How to convert inputsource to inputstream which will feed to stringreader as the parameter?
body: <p>I have requirement, where i need to get the xml from the server to parse if it is present and if not take the file from assets folder. </p>
  
  <p>What ever the xml i'm getting using inputstream im passing it as the parameter for StringReader for further processing. I'm using XmlPullParser for parsing.</p>
  
  <p>But i'm not able to pass the inputsource paramter to stringreader for further parsing. I don't to use document reader. Please find the code as below.</p>
  
  <pre><code> private void  readSynconfiguration( )
      {
  
          XmlParser xmlparser = new XmlParser();
  
              try {
                  String strFromMbo = getDataFromMBO();
                  if(strFromMbo != null &amp;&amp; !strFromMbo.isEmpty()) {   // first
                      InputSource is = new InputSource(new StringReader(strFromMbo));
                     // result = getStringFromInputStream(is);
                  }
                  else {
                      context = RetailExecutionApplication.getApp().getApplicationContext();
                      InputStream stream = context.getAssets().open("syncSettings.xml");
                      result = getStringFromInputStream(stream);
                  }
              } catch (IOException e) {
                  syncSetting = false;
                  e.printStackTrace();
              }
  
          StringReader labelReader = new StringReader(result);
  
          try {
              if(syncSetting) {
                  labelSharedInstance.clear();
                  labelSyncDetails = xmlparser.LabelsParse(labelReader);
                  labelSharedInstance = labelSyncDetails;
              }
          } catch (XmlPullParserException e) {
              syncSetting = false;
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>Please help me in this regard. </p>