Code example for InputSource

Methods: setEncoding

0
            /* Get the XMLReader of the SAXParser we created. */ 
            XMLReader xr = sp.getXMLReader();
 
            // TODO, just doing some testing 
			xr.setContentHandler(getContentHandler());
            InputSource is = new InputSource(stream);
 
            // set the encoding if requested. 
            if (mEncoding != null)  {
                is.setEncoding(mEncoding);
            } 
 
			xr.parse(is);
			stream.close();
		} 
		catch (Exception e) {
			Log.e(getClass().getCanonicalName(),
					"Failure parsing document", e);
		} 
 
		mIsFinished = true;