Here you can find the source of parseInt(char[] input, ParsePosition offset, int length)
public static long parseInt(char[] input, ParsePosition offset, int length)
//package com.java2s; /*/*from w w w. j av a 2 s.c om*/ * This file is part of the Jose Project * see http://jose-chess.sourceforge.net/ * (c) 2002-2006 Peter Sch?fer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * */ import java.text.ParsePosition; public class Main { public static long parseInt(StringBuffer input, ParsePosition offset) { long result = 0; int i; while ((i = offset.getIndex()) < input.length()) { char c = input.charAt(i); if (c >= '0' && c <= '9') { result = (result * 10) + (c - '0'); offset.setIndex(i + 1); } else break; } return result; } public static long parseInt(char[] input, ParsePosition offset, int length) { long result = 0; int i; while ((i = offset.getIndex()) < length) { char c = input[i]; if (c >= '0' && c <= '9') { result = (result * 10) + (c - '0'); offset.setIndex(i + 1); } else break; } return result; } }