Code example for InputSource

0
 
			final XMLReader xr = sp.getXMLReader();
			final TexturePackParser texturePackerParser = new AssetTexturePackParser(this.mTextureManager, pAssetManager, this.mAssetBasePath);
			xr.setContentHandler(texturePackerParser);
 
			xr.parse(new InputSource(new BufferedInputStream(pInputStream)));
 
			return texturePackerParser.getTexturePack();
		} catch (final SAXException e) {
			throw new TexturePackParseException(e);
		} catch (final ParserConfigurationException pe) {
			/* Doesn't happen. */ 
			return null; 
		} catch (final IOException e) {
			throw new TexturePackParseException(e);
		} finally { 
			StreamUtils.close(pInputStream);
		} 
	} 
 
	// ===========================================================