Java class file: Difference between revisions

Content deleted Content added
Batmat (talk | contribs)
Added Java 12. Tested myself manually using https://jdk.java.net/12/, a simple Java class and an hexadecimal editor.
Edom7 (talk | contribs)
Clarify things a little. Add reference to field_info, method_info, and attribute_info.
Line 57:
* '''u2''': an unsigned [[16-bit]] integer in [[Endianness|big-endian]] byte order
* '''u4''': an unsigned [[32-bit]] integer in big-endian byte order
* '''table''': an array of variable-length items of some type. The number of items in the table is identified by a preceding count number (the count is a u2), but the size in bytes of the table can only be determined by examining each of its items.
 
Some of these fundamental types are then re-interpreted as higher-level values (such as strings or floating-point numbers), depending on context.
Line 152:
| rowspan="4" | ''isize'' (variable)
| rowspan="4" | table
| rowspan="4" | interface table,: ana variable-length array of variable-sizedconstant pool indexes describing the interfaces implemented by this class
|-
| ...
Line 171:
| rowspan="4" | table
| rowspan="4" | field table, variable length array of fields
each element is a field_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.5
|-
| ...
Line 189 ⟶ 190:
| rowspan="4" | table
| rowspan="4" | method table, variable length array of methods
each element is a method_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.6
|-
| ...
Line 207 ⟶ 209:
| rowspan="4" | table
| rowspan="4" | attribute table, variable length array of attributes
each element is an attribute_info structure defined in https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7
|-
| ...