|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.sevenzipjbinding.impl.VolumedArchiveInStream
public class VolumedArchiveInStream
This helper class allows merging multiple instances of IInStream
interface into one. This is helpful for
accessing 7z volumed archives. 7z splits its archives into volumes on the byte layout. Each archive volume gets
extension .7z.nnn
(.7z.001
, .7z.002
, .7z.003
, ...). Such archives
can be reassembled into single archive file using simple concatenation:
cat name.7z.* > name.7z
To use this you need to implement IArchiveOpenVolumeCallback
interface.
IArchiveOpenVolumeCallback.getProperty(PropID)
with the propID
=PropID.NAME
will be
called ones to get the file name of the first volume in case it was not given to constructor. The file name should
ends with .7z.001
or SevenZipException will be thrown.
IArchiveOpenVolumeCallback.getStream(String)
will be called multiple times to get instance of
IInStream
representing required volume. The implementation of IArchiveOpenVolumeCallback
should close
file associated with the old IInStream
, if a new IInStream
was successfully instantiated.
Field Summary |
---|
Fields inherited from interface net.sf.sevenzipjbinding.IInStream |
---|
SEEK_CUR, SEEK_END, SEEK_SET |
Constructor Summary | |
---|---|
VolumedArchiveInStream(IArchiveOpenVolumeCallback archiveOpenVolumeCallback)
Creates instance of VolumedArchiveInStream using IArchiveOpenVolumeCallback . |
|
VolumedArchiveInStream(java.lang.String firstVolumeFilename,
IArchiveOpenVolumeCallback archiveOpenVolumeCallback)
Creates instance of VolumedArchiveInStream using IArchiveOpenVolumeCallback . |
Method Summary | |
---|---|
int |
read(byte[] data)
$Reads at least 1 and maximum data.length from the in-stream. |
long |
seek(long offset,
int seekOrigin)
$Move current location pointer to the new offset depending on seekOrigin |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VolumedArchiveInStream(IArchiveOpenVolumeCallback archiveOpenVolumeCallback) throws SevenZipException
VolumedArchiveInStream
using IArchiveOpenVolumeCallback
. The name of the
first archive volume will be asked using IArchiveOpenVolumeCallback.getProperty(PropID)
with the
propID
=PropID.NAME
. The file name should ends with .7z.001
or SevenZipException
will be thrown.
archiveOpenVolumeCallback
- call back implementation used to access different volumes of archive.
SevenZipException
- in error casepublic VolumedArchiveInStream(java.lang.String firstVolumeFilename, IArchiveOpenVolumeCallback archiveOpenVolumeCallback) throws SevenZipException
VolumedArchiveInStream
using IArchiveOpenVolumeCallback
.
firstVolumeFilename
- the file name of the first volume.archiveOpenVolumeCallback
- call back implementation used to access different volumes of archive. The file name should ends with
.7z.001
or SevenZipException will be thrown.
SevenZipException
- in error caseMethod Detail |
---|
public long seek(long offset, int seekOrigin) throws SevenZipException
seekOrigin
seek
in interface IInStream
offset
- absolute or relative offset in the stream to move toseekOrigin
- on of three possible seek origins:IInStream.SEEK_SET
- offset
is an absolute offset to move to,IInStream.SEEK_CUR
- offset
is a relative offset to the current position in stream,IInStream.SEEK_END
- offset
is an offset from the end of the stream
(offset <= 0)
.
SevenZipException
- in error case. If this method ends with an exception, the current operation will be reported to 7-Zip
as failed. There are no guarantee, that there are no further call back methods will be called. The
first thrown exception will be saved and thrown late on from the first called 7-Zip-JBinding main
method, such as ISevenZipInArchive.extract()
or SevenZip.openInArchive()
.public int read(byte[] data) throws SevenZipException
data.length
from the in-stream. If data.length == 0
0
should be returned. If data.length != 0
, then return value 0 indicates end-of-stream (EOF). This
means no more bytes can be read from the stream. data.length
. You must call read()
function in loop, if you need exact amount of data.
read
in interface ISequentialInStream
data
- buffer to get read data
data
array. 0 - represents end of stream.
SevenZipException
- in error case. If this method ends with an exception, the current operation will be reported to 7-Zip
as failed. There are no guarantee, that there are no further call back methods will be called. The
first thrown exception will be saved and thrown late on from the first called 7-Zip-JBinding main
method, such as ISevenZipInArchive.extract()
or SevenZip.openInArchive()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |