JarOutputStream


JarOutputStream java.util.jar

Java 1.2 closeable flushable

This class can write a JAR file to an arbitrary OutputStream . JarOutputStream extends java.util.zip.ZipOutputStream and is used much like that class is used. Create a JarOutputStream by specifying the stream to write to and, optionally , the Manifest object for the JAR file. The JarOutputStream( ) constructor starts by writing the contents of the Manifest object into an appropriate JAR file entry. It is the programmer's responsibility to ensure that the contents of the JAR entries written subsequently match those specified in the Manifest object. This class provides no explicit support for attaching digital signatures to entries in the JAR file.

After creating a JarOutputStream , call putNextEntry( ) to specify the JarEntry or java.util.zip.ZipEntry to be written to the stream. Then, call any of the inherited write( ) methods to write the contents of the entry to the stream. When that entry is finished, call putNextEntry( ) again to begin writing the next entry. When you have written all JAR file entries in this way, call close( ) . Before writing any entry, you may call the inherited setMethod( ) and setLevel( ) methods to specify how the entry should be compressed. See java.util.zip.ZipOutputStream .

Figure 16-112. java.util.jar.JarOutputStream

 public class  JarOutputStream  extends java.util.zip.ZipOutputStream {  // Public Constructors  public  JarOutputStream  (java.io.OutputStream  out  ) throws java.io.IOException;        public  JarOutputStream  (java.io.OutputStream  out  , Manifest  man  ) throws java.io.IOException;  // Public Methods Overriding ZipOutputStream  public void  putNextEntry  (java.util.zip.ZipEntry  ze  ) throws java.io.IOException;   } 

Passed To

Pack200.Unpacker.unpack( )



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net