Changeset 15425


Ignore:
Timestamp:
10/20/20 06:45:25 (3 years ago)
Author:
Mark Evenson
Message:

Create and use constructor for ZipCache?.ArchiveStream?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/ZipCache.java

    r15411 r15425  
    200200  {
    201201    ZipInputStream source;
     202    ZipEntry rootEntry;
     203
     204    public ArchiveStream(InputStream stream, JarPathname root, ZipEntry rootEntry) {
     205      if (!(stream instanceof ZipInputStream)) {
     206        this.source = new ZipInputStream(stream);
     207      } else {
     208        this.source = (ZipInputStream)stream;
     209      }
     210      this.root = root;
     211      this.rootEntry = rootEntry;
     212      this.lastModified = rootEntry.getTime(); // FIXME how to re-check time as modified?
     213    } 
    202214
    203215    // TODO wrap in a weak reference to allow JVM to possibly reclaim memory
     
    436448        return null;
    437449      }
    438       ArchiveStream stream = new ArchiveStream();
    439       stream.source = new ZipInputStream(inputStream);
    440       stream.root = innerArchive;
    441       stream.lastModified = entry.getTime();
     450      ArchiveStream stream = new ArchiveStream(inputStream, innerArchive, entry);
    442451      result = stream;
    443452      cache.put(innerArchive, result);
Note: See TracChangeset for help on using the changeset viewer.