private String printOFormat(long x){
  String sx=null;
  if (x == Long.MIN_VALUE)   sx="1000000000000000000000";
 else   if (x < 0) {
    String t=Long.toString((~(-x - 1)) ^ Long.MIN_VALUE,8);
switch (t.length()) {
case 1:
      sx="100000000000000000000" + t;
    break;
case 2:
  sx="10000000000000000000" + t;
break;
case 3:
sx="1000000000000000000" + t;
break;
case 4:
sx="100000000000000000" + t;
break;
case 5:
sx="10000000000000000" + t;
break;
case 6:
sx="1000000000000000" + t;
break;
case 7:
sx="100000000000000" + t;
break;
case 8:
sx="10000000000000" + t;
break;
case 9:
sx="1000000000000" + t;
break;
case 10:
sx="100000000000" + t;
break;
case 11:
sx="10000000000" + t;
break;
case 12:
sx="1000000000" + t;
break;
case 13:
sx="100000000" + t;
break;
case 14:
sx="10000000" + t;
break;
case 15:
sx="1000000" + t;
break;
case 16:
sx="100000" + t;
break;
case 17:
sx="10000" + t;
break;
case 18:
sx="1000" + t;
break;
case 19:
sx="100" + t;
break;
case 20:
sx="10" + t;
break;
case 21:
sx="1" + t;
break;
}
}
 else sx=Long.toString(x,8);
return printOFormat(sx);
}

private String printOFormat ( long x ) { String sx = null ; if ( x == Long . MIN_VALUE ) sx = "1000000000000000000000" ; else if ( x < 0 ) { String t = Long . toString ( ( ~ ( - x - 1 ) ) ^ Long . MIN_VALUE , 8 ) ; switch ( t . length ( ) ) { case 1 : sx = "100000000000000000000" + t ; break ; case 2 : sx = "10000000000000000000" + t ; break ; case 3 : sx = "1000000000000000000" + t ; break ; case 4 : sx = "100000000000000000" + t ; break ; case 5 : sx = "10000000000000000" + t ; break ; case 6 : sx = "1000000000000000" + t ; break ; case 7 : sx = "100000000000000" + t ; break ; case 8 : sx = "10000000000000" + t ; break ; case 9 : sx = "1000000000000" + t ; break ; case 10 : sx = "100000000000" + t ; break ; case 11 : sx = "10000000000" + t ; break ; case 12 : sx = "1000000000" + t ; break ; case 13 : sx = "100000000" + t ; break ; case 14 : sx = "10000000" + t ; break ; case 15 : sx = "1000000" + t ; break ; case 16 : sx = "100000" + t ; break ; case 17 : sx = "10000" + t ; break ; case 18 : sx = "1000" + t ; break ; case 19 : sx = "100" + t ; break ; case 20 : sx = "10" + t ; break ; case 21 : sx = "1" + t ; break ; } } else sx = Long . toString ( x , 8 ) ; return printOFormat ( sx ) ; }
format method for the o conversion character and long argument . < p / > for o format , the flag character ' - ' , means that the output should be left justified within the field . the default is to pad with blanks on the left . the ' # ' flag character means that the output begins with a leading 0 and the precision is increased by 1 . < p / > the field width is treated as the minimum number of characters to be printed . the default is to add no padding . padding is with blanks by default . < p / > the precision , if set , is the minimum number of digits to appear . padding is with leading 0s .
