Package com.e1c.g5.v8.fastzip
Interface IFzipReader
-
- All Superinterfaces:
AutoCloseable
,Closeable
public interface IFzipReader extends Closeable
FastZIP archive reader.All methods are synchronous and can be called in any order any number of times.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
countEntries()
Gets the number of entries contained in the archive.Stream<IFzipEntry>
entries()
Gets a stream of entry descriptors contained in the archive.void
read()
Restores all entries from the archive.void
setProgressListener(IProgressListener progressListener)
Sets a progress listener.
-
-
-
Method Detail
-
setProgressListener
void setProgressListener(IProgressListener progressListener)
Sets a progress listener. The listener is used to track progress ofread()
operation.- Parameters:
progressListener
- the progress listener, ornull
to remove a previously set listener
-
read
void read() throws IOException
Restores all entries from the archive. Reports the progress to a progress listener if it was set. The order in which the entries are restored is not specified.If the operation fails the reader might end up in a closed state and no guarantees on which entries were fully or partially read are provided.
- Throws:
FzipException
- if the source file is not a FastZIP archive, the archive is corrupted or written with incompatible registryIOException
- if an IO error occurs
-
countEntries
int countEntries() throws IOException
Gets the number of entries contained in the archive.- Returns:
- the number of entries
- Throws:
FzipException
- if the source file is not a FastZIP archive, the archive is corrupted or written with incompatible registryIOException
- if an IO error occurs
-
entries
Stream<IFzipEntry> entries() throws IOException
Gets a stream of entry descriptors contained in the archive. This method does not restore the entry contents.- Returns:
- the stream of FastZIP entries, never
null
- Throws:
FzipException
- if the source file is not a FastZIP archive, the archive is corrupted or written with incompatible registryIOException
- if an IO error occurs
-
-