docs: private Resource newResource(final String resourcePath) {
          return new Resource(this, /* length unknown */ -1L) {
              /** The module reader proxy. */
              private ModuleReaderProxy moduleReaderProxy;
  
              @Override
              public String getPath() {
                  return resourcePath;
              }
  
              @Override
              public String getPathRelativeToClasspathElement() {
                  return resourcePath;
              }
  
              @Override
              public synchronized ByteBuffer read() throws IOException {
                  if (skipClasspathElement) {
                      // Shouldn't happen
                      throw new IOException("Module could not be opened");
                  }
                  markAsOpen();
                  try {
                      moduleReaderProxy = moduleReaderProxyRecycler.acquire();
                      // ModuleReader#read(String name) internally calls:
                      // InputStream is = open(name); return ByteBuffer.wrap(is.readAllBytes());
                      byteBuffer = moduleReaderProxy.read(resourcePath);
                      length = byteBuffer.remaining();
                      return byteBuffer;
  
                  } catch (final SecurityException | OutOfMemoryError e) {
                      close();
                      throw new IOException("Could not open " + this, e);
                  }
              }
  
              @Override
              synchronized InputStreamOrByteBufferAdapter openOrRead() throws IOException {
                  return new InputStreamOrByteBufferAdapter(open());
              }
  
              @Override
              public synchronized InputStream open() throws IOException {
                  if (skipClasspathElement) {
                      // Shouldn't happen
                      throw new IOException("Module could not be opened");
                  }
                  markAsOpen();
                  try {
                      moduleReaderProxy = moduleReaderProxyRecycler.acquire();
                      inputStream = new InputStreamResourceCloser(this, moduleReaderProxy.open(resourcePath));
                      // Length cannot be obtained from ModuleReader
                      length = -1L;
                      return inputStream;
  
                  } catch (final SecurityException e) {
                      close();
                      throw new IOException("Could not open " + this, e);
                  }
              }
  
              @Override
              public synchronized byte[] load() throws IOException {
                  try {
                      read();
                      final byte[] byteArray = byteBufferToByteArray();
                      length = byteArray.length;
                      return byteArray;
                  } finally {
                      close();
                  }
              }
  
              @Override
              public synchronized void close() {
                  super.close(); // Close inputStream
                  if (byteBuffer != null) {
                      if (moduleReaderProxy != null) {
                          // Release any open ByteBuffer
                          moduleReaderProxy.release(byteBuffer);
                      }
                      byteBuffer = null;
                  }
                  if (moduleReaderProxy != null) {
                      // Recycle the (open) ModuleReaderProxy instance.
                      moduleReaderProxyRecycler.recycle(moduleReaderProxy);
                      // Don't call ModuleReaderProxy#close(), leave the ModuleReaderProxy open in the recycler.
                      // Just set the ref to null here. The ModuleReaderProxy will be closed by
                      // ClasspathElementModule#close().
                      moduleReaderProxy = null;
                  }
                  markAsClosed();
              }
          };
      }