public class Archive extends Object implements Closeable
| Constructor and Description |
|---|
Archive(File firstVolume) |
Archive(File firstVolume,
UnrarCallback unrarCallback) |
Archive(VolumeManager volumeManager) |
Archive(VolumeManager volumeManager,
UnrarCallback unrarCallback)
create a new archive object using the given
VolumeManager |
| Modifier and Type | Method and Description |
|---|---|
void |
bytesReadRead(int count) |
void |
close()
Close the underlying compressed file.
|
void |
extractFile(FileHeader hd,
OutputStream os)
Extract the file specified by the given header and write it to the
supplied output stream
|
List<FileHeader> |
getFileHeaders() |
InputStream |
getInputStream(FileHeader hd)
Returns an
InputStream that will allow to read the file and
stream it. |
MainHeader |
getMainHeader() |
IReadOnlyAccess |
getRof() |
UnrarCallback |
getUnrarCallback() |
Volume |
getVolume() |
VolumeManager |
getVolumeManager() |
boolean |
isEncrypted() |
boolean |
isOldFormat() |
FileHeader |
nextFileHeader() |
void |
setVolume(Volume volume) |
void |
setVolumeManager(VolumeManager volumeManager) |
public Archive(VolumeManager volumeManager) throws RarException, IOException
RarExceptionIOExceptionpublic Archive(VolumeManager volumeManager, UnrarCallback unrarCallback) throws RarException, IOException
VolumeManagervolumeManager - the the VolumeManager that will provide volume stream
dataunrarCallback - callbackRarException - if archive is badIOException - if any IO error occurpublic Archive(File firstVolume) throws RarException, IOException
RarExceptionIOExceptionpublic Archive(File firstVolume, UnrarCallback unrarCallback) throws RarException, IOException
RarExceptionIOExceptionpublic void bytesReadRead(int count)
public IReadOnlyAccess getRof()
public List<FileHeader> getFileHeaders()
public FileHeader nextFileHeader()
public UnrarCallback getUnrarCallback()
public boolean isEncrypted()
public void extractFile(FileHeader hd, OutputStream os) throws RarException
hd - the header to be extractedos - the outputstreamRarException - if archive is badpublic InputStream getInputStream(FileHeader hd) throws RarException, IOException
InputStream that will allow to read the file and
stream it. Please note that this method will create a new Thread and an a
pair of Pipe streams.hd - the header to be extractedInputStream that will allow to read the file and
stream itRarException - if archive is badIOException - if any IO error occurpublic MainHeader getMainHeader()
public boolean isOldFormat()
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic VolumeManager getVolumeManager()
public void setVolumeManager(VolumeManager volumeManager)
volumeManager - the volumeManager to setpublic Volume getVolume()
public void setVolume(Volume volume) throws IOException
volume - the volume to setIOException - if any IO error occurCopyright © 2017. All rights reserved.