docs: private Resource newResource(final FastZipEntry zipEntry, final String pathRelativeToPackageRoot) {
          return new Resource(this, zipEntry.uncompressedSize) {
              /**
               * Path with package root prefix and/or any Spring Boot prefix ("BOOT-INF/classes/" or
               * "WEB-INF/classes/") removed.
               */
              @Override
              public String getPath() {
                  return pathRelativeToPackageRoot;
              }
  
              @Override
              public String getPathRelativeToClasspathElement() {
                  return zipEntry.entryName;
              }
  
              @Override
              public synchronized InputStream open() throws IOException {
                  if (skipClasspathElement) {
                      // Shouldn't happen
                      throw new IOException("Jarfile could not be opened");
                  }
                  markAsOpen();
                  try {
                      inputStream = new InputStreamResourceCloser(this, zipEntry.open());
                      length = zipEntry.uncompressedSize;
                      return inputStream;
  
                  } catch (final IOException e) {
                      close();
                      throw e;
                  } catch (final InterruptedException e) {
                      close();
                      nestedJarHandler.interruptionChecker.interrupt();
                      throw new IOException(e);
                  }
              }
  
              @Override
              synchronized InputStreamOrByteBufferAdapter openOrRead() throws IOException {
                  return new InputStreamOrByteBufferAdapter(open());
              }
  
              @Override
              public synchronized ByteBuffer read() throws IOException {
                  try {
                      if (zipEntry.canGetAsSlice()) {
                          // For STORED entries that do not span multiple 2GB chunks, can create a
                          // ByteBuffer slice directly from the entry
                          markAsOpen();
                          // compressedSize should have the same value as uncompressedSize for STORED
                          // entries, but compressedSize is more reliable (uncompressedSize may be -1)
                          length = zipEntry.compressedSize;
                          return zipEntry.getAsSlice();
  
                      } else {
                          // Otherwise, decompress or extract the entry into a byte[] array,
                          // then wrap in a ByteBuffer
                          open();
                          return inputStreamToByteBuffer();
                      }
                  } catch (final IOException e) {
                      close();
                      throw e;
                  } catch (final InterruptedException e) {
                      close();
                      nestedJarHandler.interruptionChecker.interrupt();
                      throw new IOException(e);
                  }
              }
  
              @Override
              public synchronized byte[] load() throws IOException {
                  try {
                      open();
                      final byte[] byteArray = inputStreamToByteArray();
                      length = byteArray.length;
                      return byteArray;
                  } finally {
                      close();
                  }
              }
  
              @Override
              public synchronized void close() {
                  super.close(); // Close inputStream
                  if (byteBuffer != null) {
                      byteBuffer = null;
                  }
                  markAsClosed();
              }
          };
      }