Code example for InputSource

Methods: setCharacterStreamsetEncoding

0
        /* Create a new ContentHandler and apply it to the XML-Reader*/  
        TaskXMLHandler mTaskXMLHandler = new TaskXMLHandler(mContext, storyId);
        xr.setContentHandler(mTaskXMLHandler);
         
        /* Parse the xml-data from our URL. */ 
        InputSource inputSource = new InputSource();
        inputSource.setEncoding("UTF-8");
        inputSource.setCharacterStream(new StringReader(taskXmlResponce));
         
        /* Parse the xml-data from our URL. */ 
        xr.parse(inputSource);
        /* Parsing has finished. */ 
	} 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE