Package com.e1c.g5.v8.fastzip
Class FzipIOFactory
java.lang.Object
com.e1c.g5.v8.fastzip.FzipIOFactory
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFzipIOFactory(boolean mmapped, int numThreads) Constructs a new factory with default chunk size.FzipIOFactory(boolean mmapped, int numThreads, int chunkSize) Constructs a new factory. -
Method Summary
Modifier and TypeMethodDescriptionopenReader(Path archPath, IFzipEntryRegistry registry) Creates a new FastZIP reader.openWriter(Path archPath, IFzipEntryRegistry registry) Creates a new FastZIP writer.
-
Constructor Details
-
FzipIOFactory
public FzipIOFactory(boolean mmapped, int numThreads, int chunkSize) Constructs a new factory.- Parameters:
mmapped- whether memory mapped IO shall be used to write and read archivesnumThreads- number of threads to be used for compression and decompression, must be positivechunkSize- size of archive chunk in bytes, must be positive, values less than 4K are strongly discouraged- Throws:
IllegalArgumentException- if argument constraints are not satisfied
-
FzipIOFactory
public FzipIOFactory(boolean mmapped, int numThreads) Constructs a new factory with default chunk size.- Parameters:
mmapped- whether memory mapped IO shall be used to write and read archivesnumThreads- number of threads to be used for compression and decompression, must be positive- Throws:
IllegalArgumentException- if argument constraints are not satisfied
-
-
Method Details
-
openReader
Creates a new FastZIP reader.The file
archPathis required to exist and be a FastZIP archive, created with a compatible registry.The returned implementation is not thread-safe.
- Parameters:
archPath- the path to the archive, cannot benullregistry- the FastZIP entry registry, cannot benull- Returns:
- the reader, never
null - Throws:
IOException- if an IO error occurs
-
openWriter
Creates a new FastZIP writer.If the file
archPathalready exists, it will be overwritten.The returned implementation is not thread-safe.
- Parameters:
archPath- the path to the archive, cannot benullregistry- the FastZIP entry registry, cannot benull- Returns:
- the writer, never
null - Throws:
IOException- if an IO error occurs
-