MemoryFileManager.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class | |
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final ModuleDescriptor | descriptor
Record Component accessed by descriptor(). |
| private final ProgramDescriptor | programDescriptor
Record Component accessed by programDescriptor(). |
| Access | Constructor and Description |
|---|---|
| pack-priv | MemoryModuleFinder(Map<String, byte[]> classes, ModuleDescriptor descriptor, ProgramDescriptor programDescriptor)
|
| Modifier and Type | Method and Description |
|---|---|
| public Map | |
| public ModuleDescriptor | |
| public final boolean | equals(Object o)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public Optional | find(String name)
Implements java. Finds a reference to a module of a given name. |
| public Set | findAll()
Implements java. Returns the set of all module references that this finder can locate. |
| public final int | |
| public ProgramDescriptor | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| classes | back to summary |
|---|---|
| private final Map<String, byte[]> classes Record Component accessed by classes(). | |
| descriptor | back to summary |
|---|---|
| private final ModuleDescriptor descriptor Record Component accessed by descriptor(). | |
| programDescriptor | back to summary |
|---|---|
| private final ProgramDescriptor programDescriptor Record Component accessed by programDescriptor(). | |
| MemoryModuleFinder | back to summary |
|---|---|
| pack-priv MemoryModuleFinder(Map<String, byte[]> classes, ModuleDescriptor descriptor, ProgramDescriptor programDescriptor) | |
| classes | back to summary |
|---|---|
| public Map Record Component getter of classes. | |
| descriptor | back to summary |
|---|---|
| public ModuleDescriptor descriptor() Record Component getter of descriptor. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| find | back to summary |
|---|---|
| public Optional Implements java. Doc from java. Finds a reference to a module of a given name. A
| |
| findAll | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns the set of all module references that this finder can locate. A
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of | |
| programDescriptor | back to summary |
|---|---|
| public ProgramDescriptor programDescriptor() Record Component getter of programDescriptor. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public Optional | find(String name)
Implements java. Finds a resource, returning a URI to the resource in the module. |
| public Stream | list()
Implements java. Lists the contents of the module, returning a stream of elements that are the names of all resources in the module. |
| public Optional | open(String name)
Overrides default java. Opens a resource, returning an input stream to read the resource in the module. |
| public Optional | read(String name)
Overrides default java. Reads a resource, returning a byte buffer with the contents of the resource. |
| closed | back to summary |
|---|---|
| private volatile boolean closed | |
| MemoryModuleReader | back to summary |
|---|---|
| pack-priv MemoryModuleReader() | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes the module reader. Once closed then subsequent calls to locate or
read a resource will fail by throwing A module reader is not required to be asynchronously closeable. If a thread is reading a resource and another thread invokes the close method, then the second thread may block until the read operation is complete. | |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() throws IOException | |
| find | back to summary |
|---|---|
| public Optional Implements java. Doc from java. Finds a resource, returning a URI to the resource in the module. If the module reader can determine that the name locates a directory then the resulting URI will end with a slash ('/').
| |
| list | back to summary |
|---|---|
| public Stream Implements java. Doc from java. Lists the contents of the module, returning a stream of elements that are the names of all resources in the module. Whether the stream of elements includes names corresponding to directories in the module is module reader specific. In lazy implementations then an The returned stream may contain references to one or more open directories in the module. The directories are closed by closing the stream. The behavior of the stream when used after the module reader is closed is implementation specific and therefore not specified.
| |
| open | back to summary |
|---|---|
| public Optional Overrides default java. Doc from java. Opens a resource, returning an input stream to read the resource in the module. The behavior of the input stream when used after the module reader is closed is implementation specific and therefore not specified.
| |
| read | back to summary |
|---|---|
| public Optional Overrides default java. Doc from java. Reads a resource, returning a byte buffer with the contents of the
resource.
The element at the returned buffer's position is the first byte of the
resource, the element at the buffer's limit is the last byte of the
resource. Once consumed, the
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public ModuleReader | open()
Implements abstract java. Opens the module content for reading. |
| MemoryModuleReference | back to summary |
|---|---|
| protected MemoryModuleReference() | |
| open | back to summary |
|---|---|
| public ModuleReader open() Implements abstract java. Doc from java. Opens the module content for reading.
| |