net.sf.sevenzipjbinding.ISequentialInStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwrapper-7zip-jbinding Show documentation
Show all versions of jwrapper-7zip-jbinding Show documentation
${project.organization.name} JWrapper 7zip Jbinding
The newest version!
package net.sf.sevenzipjbinding;
/**
* Interface used to operate with sequential input stream.
*
* @author Boris Brodski
* @version 4.65-1
*/
public interface ISequentialInStream {
/**
* Reads at least 1 and maximum 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.
* This function is allowed to read less than number of remaining bytes in stream and less then
* data.length
. You must call read()
function in loop, if you need exact amount of data.
*
* @param data
* buffer to get read data
*
* @return amount of bytes written in the data
array. 0 - represents end of stream.
*
* @throws 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;
}