public final static boolean inLongRange(char[] digitChars,int offset,int len,boolean negative){
  String cmpStr=negative ? MIN_LONG_STR_NO_SIGN : MAX_LONG_STR;
  int cmpLen=cmpStr.length();
  if (len < cmpLen)   return true;
  if (len > cmpLen)   return false;
  for (int i=0; i < cmpLen; ++i) {
    if (digitChars[offset + i] > cmpStr.charAt(i)) {
      return false;
    }
  }
  return true;
}

public final static boolean inLongRange ( char [ ] digitChars , int offset , int len , boolean negative ) { String cmpStr = negative ? MIN_LONG_STR_NO_SIGN : MAX_LONG_STR ; int cmpLen = cmpStr . length ( ) ; if ( len < cmpLen ) return true ; if ( len > cmpLen ) return false ; for ( int i = 0 ; i < cmpLen ; ++ i ) { if ( digitChars [ offset + i ] > cmpStr . charAt ( i ) ) { return false ; } } return true ; }
helper method for determining if given string representation of an integral number would fit in 64 - bit java long or not . note that input string must not contain leading minus sign ( even if ' negative ' is set to true ) .
