33import software .coley .lljzip .format .model .CentralDirectoryFileHeader ;
44import software .coley .lljzip .format .model .EndOfCentralDirectory ;
55import software .coley .lljzip .format .model .ZipArchive ;
6- import software .coley .lljzip .format .read .ForwardScanZipReader ;
7- import software .coley .lljzip .format .read .JvmZipReader ;
8- import software .coley .lljzip .format .read .NaiveLocalFileZipReader ;
9- import software .coley .lljzip .format .read .ZipReader ;
6+ import software .coley .lljzip .format .read .*;
107import software .coley .lljzip .util .BufferData ;
118import software .coley .lljzip .util .ByteData ;
129import software .coley .lljzip .util .FileMapUtil ;
1512import java .io .IOException ;
1613import java .nio .file .Files ;
1714import java .nio .file .Path ;
15+ import java .util .zip .ZipFile ;
1816
1917/**
2018 * IO wrappers for reading {@link ZipArchive} contents.
@@ -64,7 +62,7 @@ public static ZipArchive readStandard(byte[] data) throws IOException {
6462 * @param data
6563 * Zip path.
6664 *
67- * @return Archive from bytes .
65+ * @return Archive from path .
6866 *
6967 * @throws IOException
7068 * When the archive bytes cannot be read from, usually indicating a malformed zip.
@@ -109,7 +107,7 @@ public static ZipArchive readNaive(byte[] data) throws IOException {
109107 * @param data
110108 * Zip path.
111109 *
112- * @return Archive from bytes .
110+ * @return Archive from path .
113111 *
114112 * @throws IOException
115113 * When the archive bytes cannot be read from, usually indicating a malformed zip.
@@ -157,7 +155,7 @@ public static ZipArchive readJvm(byte[] data) throws IOException {
157155 * @param path
158156 * Zip path.
159157 *
160- * @return Archive from bytes .
158+ * @return Archive from path .
161159 *
162160 * @throws IOException
163161 * When the archive bytes cannot be read from, usually indicating a malformed zip.
@@ -166,6 +164,22 @@ public static ZipArchive readJvm(Path path) throws IOException {
166164 return read (path , new JvmZipReader ());
167165 }
168166
167+ /**
168+ * Creates an archive using the {@link AdaptingZipReader} which delegates work to {@link ZipFile}.
169+ *
170+ * @param path
171+ * Zip path.
172+ *
173+ * @return Archive from path.
174+ *
175+ * @throws IOException
176+ */
177+ public static ZipArchive readAdaptingIO (Path path ) throws IOException {
178+ ZipArchive archive = new ZipArchive ();
179+ AdaptingZipReader .fill (archive , path .toFile ());
180+ return archive ;
181+ }
182+
169183 /**
170184 * @param data
171185 * Zip bytes.
@@ -189,7 +203,7 @@ public static ZipArchive read(byte[] data, ZipReader strategy) throws IOExceptio
189203 * @param strategy
190204 * Zip reader implementation.
191205 *
192- * @return Archive from bytes .
206+ * @return Archive from path .
193207 *
194208 * @throws IOException
195209 * When the archive bytes cannot be read from, usually indicating a malformed zip.
0 commit comments