ClassFileAnalyzer (Can)
Home

Example: TestCanOptionInfo

Test option -info

 

/* TestCanOptionInfo.java */

public class TestCanOptionInfo {
  
  public static void main(String[] args) {
    System.out.println("Hello World!");    
  }
}

 

> javac TestCanOptionInfo.java
> java ClassFileAnalyzer -info TestCanOptionInfo.class

 

TestCanOptionInfo.class consists of the following integers (440 Bytes):

0: 202 254 186 190 0 0 0 50 0 29 10 0 6 0 15 9 
16: 0 16 0 17 8 0 18 10 0 19 0 20 7 0 21 7 
32: 0 22 1 0 6 60 105 110 105 116 62 1 0 3 40 41 
48: 86 1 0 4 67 111 100 101 1 0 15 76 105 110 101 78 
64: 117 109 98 101 114 84 97 98 108 101 1 0 4 109 97 105 
80: 110 1 0 22 40 91 76 106 97 118 97 47 108 97 110 103 
96: 47 83 116 114 105 110 103 59 41 86 1 0 10 83 111 117 
112: 114 99 101 70 105 108 101 1 0 22 84 101 115 116 67 97 
128: 110 79 112 116 105 111 110 73 110 102 111 46 106 97 118 97 
144: 12 0 7 0 8 7 0 23 12 0 24 0 25 1 0 12 
160: 72 101 108 108 111 32 87 111 114 108 100 33 7 0 26 12 
176: 0 27 0 28 1 0 17 84 101 115 116 67 97 110 79 112 
192: 116 105 111 110 73 110 102 111 1 0 16 106 97 118 97 47 
208: 108 97 110 103 47 79 98 106 101 99 116 1 0 16 106 97 
224: 118 97 47 108 97 110 103 47 83 121 115 116 101 109 1 0 
240: 3 111 117 116 1 0 21 76 106 97 118 97 47 105 111 47 
256: 80 114 105 110 116 83 116 114 101 97 109 59 1 0 19 106 
272: 97 118 97 47 105 111 47 80 114 105 110 116 83 116 114 101 
288: 97 109 1 0 7 112 114 105 110 116 108 110 1 0 21 40 
304: 76 106 97 118 97 47 108 97 110 103 47 83 116 114 105 110 
320: 103 59 41 86 0 33 0 5 0 6 0 0 0 0 0 2 
336: 0 1 0 7 0 8 0 1 0 9 0 0 0 29 0 1 
352: 0 1 0 0 0 5 42 183 0 1 177 0 0 0 1 0 
368: 10 0 0 0 6 0 1 0 0 0 3 0 9 0 11 0 
384: 12 0 1 0 9 0 0 0 37 0 2 0 1 0 0 0 
400: 9 178 0 2 18 3 182 0 4 177 0 0 0 1 0 10 
416: 0 0 0 10 0 2 0 0 0 6 0 8 0 7 0 1 
432: 0 13 0 0 0 2 0 14 


Hexdump TestCanOptionInfo.class (440 Bytes):

ca fe ba be 00 00 00 32 00 1d 0a 00 06 00 0f 09     .......2........     0
00 10 00 11 08 00 12 0a 00 13 00 14 07 00 15 07     ................     16
00 16 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29     .....<init>...()     32
56 01 00 04 43 6f 64 65 01 00 0f 4c 69 6e 65 4e     V...Code...LineN     48
75 6d 62 65 72 54 61 62 6c 65 01 00 04 6d 61 69     umberTable...mai     64
6e 01 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67     n...([Ljava/lang     80
2f 53 74 72 69 6e 67 3b 29 56 01 00 0a 53 6f 75     /String;)V...Sou     96
72 63 65 46 69 6c 65 01 00 16 54 65 73 74 43 61     rceFile...TestCa     112
6e 4f 70 74 69 6f 6e 49 6e 66 6f 2e 6a 61 76 61     nOptionInfo.java     128
0c 00 07 00 08 07 00 17 0c 00 18 00 19 01 00 0c     ................     144
48 65 6c 6c 6f 20 57 6f 72 6c 64 21 07 00 1a 0c     Hello World!....     160
00 1b 00 1c 01 00 11 54 65 73 74 43 61 6e 4f 70     .......TestCanOp     176
74 69 6f 6e 49 6e 66 6f 01 00 10 6a 61 76 61 2f     tionInfo...java/     192
6c 61 6e 67 2f 4f 62 6a 65 63 74 01 00 10 6a 61     lang/Object...ja     208
76 61 2f 6c 61 6e 67 2f 53 79 73 74 65 6d 01 00     va/lang/System..     224
03 6f 75 74 01 00 15 4c 6a 61 76 61 2f 69 6f 2f     .out...Ljava/io/     240
50 72 69 6e 74 53 74 72 65 61 6d 3b 01 00 13 6a     PrintStream;...j     256
61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65     ava/io/PrintStre     272
61 6d 01 00 07 70 72 69 6e 74 6c 6e 01 00 15 28     am...println...(     288
4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e     Ljava/lang/Strin     304
67 3b 29 56 00 21 00 05 00 06 00 00 00 00 00 02     g;)V.!..........     320
00 01 00 07 00 08 00 01 00 09 00 00 00 1d 00 01     ................     336
00 01 00 00 00 05 2a b7 00 01 b1 00 00 00 01 00     ......*.........     352
0a 00 00 00 06 00 01 00 00 00 03 00 09 00 0b 00     ................     368
0c 00 01 00 09 00 00 00 25 00 02 00 01 00 00 00     ........%.......     384
09 b2 00 02 12 03 b6 00 04 b1 00 00 00 01 00 0a     ................     400
00 00 00 0a 00 02 00 00 00 06 00 08 00 07 00 01     ................     416
00 0d 00 00 00 02 00 0e                             ........             432

magic: 202 254 186 190

minor_version: 0 0
major_version: 0 50

constant_pool_count: 0 29
constant_pool (indexed from 1 to constant_pool_count-1):
  1 (CONSTANT_Methodref_info): 10 0 6 0 15 
  2 (CONSTANT_Fieldref_info): 9 0 16 0 17 
  3 (CONSTANT_String_info): 8 0 18 
  4 (CONSTANT_Methodref_info): 10 0 19 0 20 
  5 (CONSTANT_Class_info): 7 0 21 
  6 (CONSTANT_Class_info): 7 0 22 
  7 (CONSTANT_Utf8_info): 1 0 6 60 105 110 105 116 62 
  8 (CONSTANT_Utf8_info): 1 0 3 40 41 86 
  9 (CONSTANT_Utf8_info): 1 0 4 67 111 100 101 
  10 (CONSTANT_Utf8_info): 1 0 15 76 105 110 101 78 117 109 98 101 114 84 97 98
          108 101 
  11 (CONSTANT_Utf8_info): 1 0 4 109 97 105 110 
  12 (CONSTANT_Utf8_info): 1 0 22 40 91 76 106 97 118 97 47 108 97 110 103 47 83
          116 114 105 110 103 59 41 86 
  13 (CONSTANT_Utf8_info): 1 0 10 83 111 117 114 99 101 70 105 108 101 
  14 (CONSTANT_Utf8_info): 1 0 22 84 101 115 116 67 97 110 79 112 116 105 111
          110 73 110 102 111 46 106 97 118 97 
  15 (CONSTANT_NameAndType_info): 12 0 7 0 8 
  16 (CONSTANT_Class_info): 7 0 23 
  17 (CONSTANT_NameAndType_info): 12 0 24 0 25 
  18 (CONSTANT_Utf8_info): 1 0 12 72 101 108 108 111 32 87 111 114 108 100 33 
  19 (CONSTANT_Class_info): 7 0 26 
  20 (CONSTANT_NameAndType_info): 12 0 27 0 28 
  21 (CONSTANT_Utf8_info): 1 0 17 84 101 115 116 67 97 110 79 112 116 105 111
          110 73 110 102 111 
  22 (CONSTANT_Utf8_info): 1 0 16 106 97 118 97 47 108 97 110 103 47 79 98 106
          101 99 116 
  23 (CONSTANT_Utf8_info): 1 0 16 106 97 118 97 47 108 97 110 103 47 83 121 115
          116 101 109 
  24 (CONSTANT_Utf8_info): 1 0 3 111 117 116 
  25 (CONSTANT_Utf8_info): 1 0 21 76 106 97 118 97 47 105 111 47 80 114 105 110
          116 83 116 114 101 97 109 59 
  26 (CONSTANT_Utf8_info): 1 0 19 106 97 118 97 47 105 111 47 80 114 105 110 116
          83 116 114 101 97 109 
  27 (CONSTANT_Utf8_info): 1 0 7 112 114 105 110 116 108 110 
  28 (CONSTANT_Utf8_info): 1 0 21 40 76 106 97 118 97 47 108 97 110 103 47 83
          116 114 105 110 103 59 41 86 

1. CONSTANT_Methodref: method of class #6, name/type #15
2. CONSTANT_Fieldref: field of class #16, name/type #17
3. CONSTANT_String: String #18
4. CONSTANT_Methodref: method of class #19, name/type #20
5. CONSTANT_Class: class #21
6. CONSTANT_Class: class #22
7. CONSTANT_Utf8: <init>
8. CONSTANT_Utf8: ()V
9. CONSTANT_Utf8: Code
10. CONSTANT_Utf8: LineNumberTable
11. CONSTANT_Utf8: main
12. CONSTANT_Utf8: ([Ljava/lang/String;)V
13. CONSTANT_Utf8: SourceFile
14. CONSTANT_Utf8: TestCanOptionInfo.java
15. CONSTANT_NameAndType: name #7, type #8
16. CONSTANT_Class: class #23
17. CONSTANT_NameAndType: name #24, type #25
18. CONSTANT_Utf8: Hello World!
19. CONSTANT_Class: class #26
20. CONSTANT_NameAndType: name #27, type #28
21. CONSTANT_Utf8: TestCanOptionInfo
22. CONSTANT_Utf8: java/lang/Object
23. CONSTANT_Utf8: java/lang/System
24. CONSTANT_Utf8: out
25. CONSTANT_Utf8: Ljava/io/PrintStream;
26. CONSTANT_Utf8: java/io/PrintStream
27. CONSTANT_Utf8: println
28. CONSTANT_Utf8: (Ljava/lang/String;)V


access_flags: 0 33
this_class: 0 5
super_class: 0 6

interfaces_count: 0 0
interfaces:

fields_count: 0 0
fields:

methods_count: 0 2
methods:
  1 (method_info): 0 1 0 7 0 8 0 1 0 9 0 0 0 29 0 1 0 1 0 0 0 5 42 183 0 1 177 0
          0 0 1 0 10 0 0 0 6 0 1 0 0 0 3 
  2 (method_info): 0 9 0 11 0 12 0 1 0 9 0 0 0 37 0 2 0 1 0 0 0 9 178 0 2 18 3
          182 0 4 177 0 0 0 1 0 10 0 0 0 10 0 2 0 0 0 6 0 8 0 7 

attributes_count: 0 1
attributes:
  1 (attribute_info): 0 13 0 0 0 2 0 14 




; TestCanOptionInfo.j

; Generated by ClassFileAnalyzer (Can)
; Analyzer and Disassembler for Java class files
; (Jasmin syntax 2, http://jasmin.sourceforge.net)
;
; ClassFileAnalyzer, version 0.7.0 


.bytecode 50.0
.source TestCanOptionInfo.java
.class public TestCanOptionInfo
.super java/lang/Object

.method public <init>()V
  .limit stack 1
  .limit locals 1
  .line 3
  0: aload_0
  1: invokespecial java/lang/Object/<init>()V
  4: return
.end method

.method public static main([Ljava/lang/String;)V
  .limit stack 2
  .limit locals 1
  .line 6
  0: getstatic java/lang/System/out Ljava/io/PrintStream;
  3: ldc "Hello World!"
  5: invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
  .line 7
  8: return
.end method