Here you can find the source of loadIntArrayByParser(XmlPullParser parser)
public static int[] loadIntArrayByParser(XmlPullParser parser)
//package com.java2s; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; public class Main { public static int[] loadIntArrayByParser(XmlPullParser parser) { String line;//from www .j ava 2s . c o m try { line = parser.nextText(); line = line.trim(); line = line.replace("\\r\\n", " "); line = line.replace("\n", " "); String[] szStrings = line.split("[ ]+"); int length = szStrings.length; int[] re = new int[length]; for (int i = 0; i < length; i++) { re[i] = Integer.parseInt(szStrings[i]); } return re; } catch (XmlPullParserException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } }