Package com.e1c.g5.v8.fastzip
Class FzipIOFactory
- java.lang.Object
-
- com.e1c.g5.v8.fastzip.FzipIOFactory
-
public class FzipIOFactory extends Object
- See Also:
com.e1c.g5.v8.fastzip
-
-
Constructor Summary
Constructors Constructor Description FzipIOFactory(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFzipReader
openReader(Path archPath, IFzipEntryRegistry registry)
Creates a new FastZIP reader.IFzipWriter
openWriter(Path archPath, IFzipEntryRegistry registry)
Creates a new FastZIP writer.
-
-
-
Constructor Detail
-
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 Detail
-
openReader
public IFzipReader openReader(Path archPath, IFzipEntryRegistry registry) throws IOException
Creates a new FastZIP reader.The file
archPath
is 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 benull
registry
- the FastZIP entry registry, cannot benull
- Returns:
- the reader, never
null
- Throws:
IOException
- if an IO error occurs
-
openWriter
public IFzipWriter openWriter(Path archPath, IFzipEntryRegistry registry) throws IOException
Creates a new FastZIP writer.If the file
archPath
already exists, it will be overwritten.The returned implementation is not thread-safe.
- Parameters:
archPath
- the path to the archive, cannot benull
registry
- the FastZIP entry registry, cannot benull
- Returns:
- the writer, never
null
- Throws:
IOException
- if an IO error occurs
-
-