Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JDK 11 java.base.jmod - Base Module
JDK 11 java.base.jmod is the JMOD file for JDK 11 Base module.
JDK 11 Base module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.base.jmod.
JDK 11 Base module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Base module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.base.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/jmod/JmodFile.java
/* * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.internal.jmod; import java.io.BufferedInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; /** * Helper class to read JMOD file */ public class JmodFile implements AutoCloseable { // jmod magic number and version number private static final int JMOD_MAJOR_VERSION = 0x01; private static final int JMOD_MINOR_VERSION = 0x00; private static final byte[] JMOD_MAGIC_NUMBER = { 0x4A, 0x4D, /* JM */ JMOD_MAJOR_VERSION, JMOD_MINOR_VERSION, /* version 1.0 */ }; public static void checkMagic(Path file) throws IOException { try (InputStream in = Files.newInputStream(file); BufferedInputStream bis = new BufferedInputStream(in)) { // validate the header byte[] magic = new byte[4]; bis.read(magic); if (magic[0] != JMOD_MAGIC_NUMBER[0] || magic[1] != JMOD_MAGIC_NUMBER[1]) { throw new IOException("Invalid JMOD file: " + file.toString()); } if (magic[2] > JMOD_MAJOR_VERSION || (magic[2] == JMOD_MAJOR_VERSION && magic[3] > JMOD_MINOR_VERSION)) { throw new IOException("Unsupported jmod version: " + magic[2] + "." + magic[3] + " in " + file.toString()); } } } /** * JMOD sections */ public static enum Section { CLASSES("classes"), CONFIG("conf"), HEADER_FILES("include"), LEGAL_NOTICES("legal"), MAN_PAGES("man"), NATIVE_LIBS("lib"), NATIVE_CMDS("bin"); private final String jmodDir; private Section(String jmodDir) { this.jmodDir = jmodDir; } /** * Returns the directory name in the JMOD file corresponding to * this section */ public String jmodDir() { return jmodDir; } } /** * JMOD file entry. * * Each entry corresponds to a ZipEntry whose name is: * Section::jmodDir + '/' + name */ public static class Entry { private final ZipEntry zipEntry; private final Section section; private final String name; private Entry(ZipEntry e) { String name = e.getName(); int i = name.indexOf('/'); if (i <= 1) { throw new RuntimeException("invalid jmod entry: " + name); } this.zipEntry = e; this.section = section(name.substring(0, i)); this.name = name.substring(i+1); } /** * Returns the section of this entry. */ public Section section() { return section; } /** * Returns the name of this entry. */ public String name() { return name; } /** * Returns true if the entry is a directory in the JMOD file. */ public boolean isDirectory() { return zipEntry.isDirectory(); } /** * Returns the size of this entry. */ public long size() { return zipEntry.getSize(); } public ZipEntry zipEntry() { return zipEntry; } @Override public String toString() { return section.jmodDir() + "/" + name; } /* * A map from the jmodDir name to Section */ static final Map<String, Section> NAME_TO_SECTION = Arrays.stream(Section.values()) .collect(Collectors.toMap(Section::jmodDir, Function.identity())); static Section section(String name) { if (!NAME_TO_SECTION.containsKey(name)) { throw new IllegalArgumentException("invalid section: " + name); } return NAME_TO_SECTION.get(name); } } private final Path file; private final ZipFile zipfile; /** * Constructs a {@code JmodFile} from a given path. */ public JmodFile(Path file) throws IOException { checkMagic(file); this.file = file; this.zipfile = new ZipFile(file.toFile()); } public static void writeMagicNumber(OutputStream os) throws IOException { os.write(JMOD_MAGIC_NUMBER); } /** * Returns the {@code Entry} for a resource in a JMOD file section * or {@code null} if not found. */ public Entry getEntry(Section section, String name) { String entry = section.jmodDir() + "/" + name; ZipEntry ze = zipfile.getEntry(entry); return (ze != null) ? new Entry(ze) : null; } /** * Opens an {@code InputStream} for reading the named entry of the given * section in this JMOD file. * * @throws IOException if the named entry is not found, or I/O error * occurs when reading it */ public InputStream getInputStream(Section section, String name) throws IOException { String entry = section.jmodDir() + "/" + name; ZipEntry e = zipfile.getEntry(entry); if (e == null) { throw new IOException(name + " not found: " + file); } return zipfile.getInputStream(e); } /** * Opens an {@code InputStream} for reading an entry in the JMOD file. * * @throws IOException if an I/O error occurs */ public InputStream getInputStream(Entry entry) throws IOException { return zipfile.getInputStream(entry.zipEntry()); } /** * Returns a stream of entries in this JMOD file. */ public Stream<Entry> stream() { return zipfile.stream() .map(Entry::new); } @Override public void close() throws IOException { if (zipfile != null) { zipfile.close(); } } }
⏎ jdk/internal/jmod/JmodFile.java
Or download all of them as a single archive file:
File name: java.base-11.0.1-src.zip File size: 8740354 bytes Release date: 2018-11-04 Download
2020-05-29, 206388👍, 0💬
Popular Posts:
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...
maven-core-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Core module. Apache Maven is a software ...
ANTLR is a powerful parser generator for multiple programming languages including Java. ANTLR contai...
What Is poi-scratchpad-5.2.3.jar ?poi-scratchpad-5.2.3.jar is one of the JAR files for Apache POI 5....
What Is HttpComponents httpclient-4.2.2.jar? HttpComponents httpclient-4.2.2.jar is the JAR file for...