| |
|
| com.izforge.izpack.util.JarOutputStream
JarOutputStream | public class JarOutputStream extends org.apache.tools.zip.ZipOutputStream (Code) | | IzPack will be able to support different compression methods for the
packs included in the installation jar file.
For this a jar output stream will be needed with which the info
data (size, CRC) can be written after the compressed data.
This is not possible with the standard class
java.util.jar.JarOutputStream. Therefore we create an own class
which supports it. Really the hole work will be delegated to the
ZipOutputStream from the apache team which solves the problem.
author: Klaus Bartz |
Method Summary | |
public void | close() Closes this output stream and releases any system resources
associated with the stream if isPreventClose is not true.
Else nothing will be done. | public void | closeAlways() Closes this output stream and releases any system resources
associated with the stream also isPreventClose is true. | public boolean | isPreventClose() | public void | putNextEntry(org.apache.tools.zip.ZipEntry ze) Begins writing a new JAR file entry and positions the stream
to the start of the entry data. | public void | setPreventClose(boolean preventClose) Determine whether a call of the close method
will be performed or not. |
JarOutputStream | public JarOutputStream(OutputStream out) throws IOException(Code) | | Creates a new JarOutputStream with no manifest.
Using this constructor it will be NOT possible to write
data with compression format STORED to the stream without
declare the info data (size, CRC) at putNextEntry .
Parameters: out - the actual output stream exception: IOException - if an I/O error has occurred |
JarOutputStream | public JarOutputStream(File fout, Manifest man) throws IOException(Code) | | Creates a new JarOutputStream with the specified
Manifest . The manifest is written as the first
entry to the output stream which will be created from the
file argument.
Parameters: fout - the file object with which the output streamshould be created Parameters: man - the Manifest exception: IOException - if an I/O error has occurred |
JarOutputStream | public JarOutputStream(File arg0) throws IOException(Code) | | Creates a new JarOutputStream with no manifest.
Will use random access if possible.
Parameters: arg0 - the file object with which the output streamshould be created throws: java.io.IOException - |
close | public void close() throws IOException(Code) | | Closes this output stream and releases any system resources
associated with the stream if isPreventClose is not true.
Else nothing will be done. This is a hack for
FilterOutputStreams like the CBZip2OutputStream which
calls the close method of the slave at finalizing the class
may be triggert by the GC.
exception: IOException - if an I/O error occurs. |
closeAlways | public void closeAlways() throws IOException(Code) | | Closes this output stream and releases any system resources
associated with the stream also isPreventClose is true.
This is a hack for FilterOutputStreams like the CBZip2OutputStream which
calls the close method of the slave at finalizing the class
may be triggert by the GC.
exception: IOException - if an I/O error occurs. |
isPreventClose | public boolean isPreventClose()(Code) | | Returns the preventClose. |
putNextEntry | public void putNextEntry(org.apache.tools.zip.ZipEntry ze) throws IOException(Code) | | Begins writing a new JAR file entry and positions the stream
to the start of the entry data. This method will also close
any previous entry. The default compression method will be
used if no compression method was specified for the entry.
The current time will be used if the entry has no set modification
time.
Parameters: ze - the ZIP/JAR entry to be written exception: java.util.zip.ZipException - if a ZIP error has occurred exception: IOException - if an I/O error has occurred |
setPreventClose | public void setPreventClose(boolean preventClose)(Code) | | Determine whether a call of the close method
will be performed or not. This is a hack for
FilterOutputStreams like the CBZip2OutputStream
of apache which calls close of the slave via
the final method which will be called from
the garbage collector.
Parameters: preventClose - The preventClose to set. |
|
|
|