Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2013
359
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. String a(int myInt) {
  2. StringBuilder sb = new StringBuilder();
  3. sb.append(Integer.toHexString(myInt));
  4. if (sb.length() < 2) {
  5. sb.insert(0, '0'); // pad with leading zero if needed
  6. }
  7. return sb.toString();
  8. }
  9.  
  10. static java.lang.String a(int);
  11. Code:
  12. 0: new #8; //class java/lang/StringBuilder
  13. 3: dup
  14. 4: invokespecial #9; //Method java/lang/StringBuilder."<init>":()V
  15. 7: astore_1
  16. 8: aload_1
  17. 9: iload_0
  18. 10: invokestatic #10; //Method java/lang/Integer.toHexString:(I)Ljava/lang/String;
  19. 13: invokevirtual #11; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  20. 16: pop
  21. 17: aload_1
  22. 18: invokevirtual #12; //Method java/lang/StringBuilder.length:()I
  23. 21: iconst_2
  24. 22: if_icmpge 33
  25. 25: aload_1
  26. 26: iconst_0
  27. 27: bipush 48
  28. 29: invokevirtual #13; //Method java/lang/StringBuilder.insert:(IC)Ljava/lang/StringBuilder;
  29. 32: pop
  30. 33: aload_1
  31. 34: invokevirtual #14; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
  32. 37: areturn
  33.  
  34.  
  35.  
  36. String b(int myInt) {
  37. String s = Integer.toHexString(myInt);
  38. if(s.length() < 2) {
  39. s = '0' + s;
  40. }
  41. return s;
  42. }
  43.  
  44. static java.lang.String b(int);
  45. Code:
  46. 0: iload_0
  47. 1: invokestatic #10; //Method java/lang/Integer.toHexString:(I)Ljava/lang/String;
  48. 4: astore_1
  49. 5: aload_1
  50. 6: invokevirtual #15; //Method java/lang/String.length:()I
  51. 9: iconst_2
  52. 10: if_icmpge 33
  53. 13: new #8; //class java/lang/StringBuilder
  54. 16: dup
  55. 17: invokespecial #9; //Method java/lang/StringBuilder."<init>":()V
  56. 20: bipush 48
  57. 22: invokevirtual #16; //Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
  58. 25: aload_1
  59. 26: invokevirtual #11; //Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
  60. 29: invokevirtual #14; //Method java/lang/StringBuilder.toString:()Ljava/lang/String;
  61. 32: astore_1
  62. 33: aload_1
  63. 34: areturn
  64.  
  65. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement