diff --git a/docs/build.main.kts b/docs/build.main.kts index 1d617180cbfe..198753e34175 100644 --- a/docs/build.main.kts +++ b/docs/build.main.kts @@ -144,10 +144,12 @@ fun transformSvg(svgFile: Path) { transformer.setOutputProperty(OutputKeys.INDENT, "yes") @Suppress("HttpUrlsUsage") transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2") - // so, first node of insertAdjacentHTML result will be svg and not comment + // so, the first node of insertAdjacentHTML result will be svg and not comment transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes") + val fileHeader = "\n".encodeToByteArray() Files.newOutputStream(svgFile).buffered().use { fileOut -> + fileOut.write(fileHeader) transformer.transform(DOMSource(document.documentElement), StreamResult(fileOut)) } } @@ -192,13 +194,18 @@ fun extractFontStyle(element: Element, classNameToBuilder: MutableMap IntelliJ Platform Activity Diagrams - - + +
-
- +
+
diff --git a/docs/out/jar-format.svg b/docs/out/jar-format.svg new file mode 100644 index 000000000000..b426f88f9531 --- /dev/null +++ b/docs/out/jar-format.svg @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + A + + ZIP + + file format with optimized metadata. + + + + File entry __index__ + + + + + names + + + + + A list of keys along with their corresponding offsets and sizes. + + + + + A list of pairs consisting of long values. + Each pair includes a key, represented as a 64-bit XXH3 hash of an entry name, + and an offset and size represented as two ints packed into a single long value. + This list enables the retrieval of data locations for all entries in a single bulk read operation. + It contains no file names or other unnecessary metadata. + + + + + class package hashes + + + + + A list of long values representing the 64-bit XXH3 hash of a package name. + This list is not used by the ZipFile implementation but is consumed by the class loader. + It allows for a quick determination of whether a class name is located within a ZIP file or not. + While it does not provide much benefit for a single ZIP file, as name lookup can be done with a single map lookup, + it enables the clustering of multiple ZIP files. + This clustering helps avoid a linear search across all ZIP files in a classpath. + + + + + resource package hashes + + + + + The same concept applies to resource package hashes. + However, there are two different sets of hashes since there is no correlation + between class packages and resource packages. + + + + + Entry names. They are not loaded into memory when the ZipFile is opened; + instead, they are loaded only when requested. + This is useful, for instance, when you want to process entries based on their names, + such as finding entries by a specific prefix. + + + + + name lengths + + + + + A list of name lengths represented as shorts. + This list enables the reading of integers in a single bulk read operation, + directly from native memory. + + + + + names + + + + + List of strings. + + + + + File Entry 1 + + + + + File Entry N + + + + + The relative offset of the local file header does not point directly to the data, + but rather to the header itself. This means that you need to perform two seeks + in order to locate the actual data, as the size of the local file header can vary. +   + As an optimization, you can attempt to precompute the data offset + when reading the central directory file header. + This optimization is implemented in the HashMapZipFile class. + However, ImmutableZipFile uses a special index for this purpose, as explained below. + + + + + The Zip specification is not violated. + The index data represents a regular file entry. + + + + + Central directory + + + + + The index format version is stored in the 'File comment' field. + Only the latest format is supported. + If a ZIP file does not have a comment or the index version is not equal to the latest, + a fallback implementation is used that is capable of reading any ZIP file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +