2 minutes
Week1026_review
ARTS - Review 补2019.1.2
Java Class文件格式
本片来自于官网文档: Chapter 4. The class File Format
- definition n. 定义
- external 外部的
- representation 表现
- literally 字面上的
- colloquially 口语的,白话的
- consists 包括
- respectively 分别地,各自地
This chapter describes the class file format of the Java Virtual Machine. Each class file contains the definition of a single class or interface. Although a class or interface need not have an external representation literally contained in a file (for instance, because the class is generated by a class loader), we will colloquially refer to any valid representation of a class or interface as being in the class file format.
本章描述Java虚拟机 类文件格式。每个class文件包括一个单个clas或接口的定义。尽管一个class或接口不需要有一个包含在一个文件外部字面上的表示(例如,因为class是通过一个类加载器构造的),我们通俗的将类或接口的任何有效表示称为类文件格式。
A class file consists of a stream of 8-bit bytes. All 16-bit, 32-bit, and 64-bit quantities are constructed by reading in two, four, and eight consecutive 8-bit bytes, respectively. Multibyte data items are always stored in big-endian order, where the high bytes come first. In the Java SE platform, this format is supported by interfaces java.io.DataInput and java.io.DataOutput and classes such as java.io.DataInputStream and java.io.DataOutputStream.
一个class文件由8位字节流组成。所有的的16位、32位、64位的数量都是通过分别读取两个、四个和八个连续的8位字节来构造的。多字节数据项始终以big-endian 顺序存储,其中高字节首先出现。在Java SE平台, 这个格式被接口 java.io.DataInput 和java.io.DataOupt 支持, 被类支持诸如 java.io.DataInputStream 和 java.io.DataOutputStream.
This chapter defines its own set of data types representing class file data: The types u1, u2, and u4 represent an unsigned one-, two-, or four-byte quantity, respectively. In the Java SE platform, these types may be read by methods such as readUnsignedByte, readUnsignedShort, and readInt of the interface java.io.DataInput.
这个章节定义了它自己的一群代表类文件的数据类型: 类型 u1, u2和u4 代表一个无符号的 一,二,或四字节数量的区别。在Java平台,这些类型可能被方法 readUnsignedByte,readUnsignedShort, 和接口里的java.io.DataInput readInt 读取。
This chapter presents the class file format using pseudostructures written in a C-like structure notation. To avoid confusion with the fields of classes and class instances, etc., the contents of the structures describing the class file format are referred to as items. Successive items are stored in the class file sequentially, without padding or alignment.
本章呈现类文件格式使用像C语言结构的伪代码。为避免类属性和类实例混乱,类文件格式描述结构作为项目提及。连续项目按顺序村塾在类文件中,无需填充或对齐。
Tables, consisting of zero or more variable-sized items, are used in several class file structures. Although we use C-like array syntax to refer to table items, the fact that tables are streams of varying-sized structures means that it is not possible to translate a table index directly to a byte offset into the table.
Where we refer to a data structure as an array, it consists of zero or more contiguous fixed-sized items and can be indexed like an array.
Reference to an ASCII character in this chapter should be interpreted to mean the Unicode code point corresponding to the ASCII character.
由零个或多个可变大小的项组成的表用于多个类文件结构中。 尽管我们使用类似C的数组语法来引用表项,但表是不同大小结构的流这一事实意味着无法将表索引直接转换为表中的字节偏移量。
在我们将数据结构称为数组的情况下,它由零个或多个连续的固定大小的项组成,并且可以像数组一样索引。
本章中对ASCII字符的引用应解释为与ASCII字符对应的Unicode代码点。