public static byte readNumber(@NonNull String str,int start,int end){
  String result=str.substring(start,end);
  if (result.isEmpty())   return -1;
 else   return (byte)Integer.parseInt(result,10);
}

public static byte readNumber ( @ NonNull String str , int start , int end ) { String result = str . substring ( start , end ) ; if ( result . isEmpty ( ) ) return - 1 ; else return ( byte ) Integer . parseInt ( result , 10 ) ; }
try to read a number from a string in specified bounds
