Here you can find the source of getPullParser(InputStream in, String encoding)
public static XmlPullParser getPullParser(InputStream in, 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 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; }/* w ww. j ava 2 s.co m*/ }