Here you can find the source of getPullParserFromClass( ClassLoader classLoader, String fileName, String encoding)
public static XmlPullParser getPullParserFromClass( ClassLoader classLoader, String fileName, String encoding) throws XmlPullParserException
//package com.java2s; //License from project: Apache License import java.io.InputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; public class Main { public static XmlPullParser getPullParserFromClass( ClassLoader classLoader, String fileName, String encoding) throws XmlPullParserException { return getPullParser(classLoader.getResourceAsStream(fileName), encoding);// w w w . j av a2s. co m } public static XmlPullParser getPullParser(InputStream in, String encoding) throws XmlPullParserException { XmlPullParserFactory factory = XmlPullParserFactory.newInstance(); factory.setNamespaceAware(true); XmlPullParser pullParser = null; pullParser = factory.newPullParser(); pullParser.setInput(in, encoding); return pullParser; } }