<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2-rc) on Fri Jun 13 00:14:46 PDT 2003 --> <TITLE> JarInputStream (Java 2 Platform SE v1.4.2) </TITLE> <META NAME="keywords" CONTENT="java.util.jar.JarInputStream class"> <META NAME="keywords" CONTENT="getManifest()"> <META NAME="keywords" CONTENT="getNextEntry()"> <META NAME="keywords" CONTENT="getNextJarEntry()"> <META NAME="keywords" CONTENT="read()"> <META NAME="keywords" CONTENT="createZipEntry()"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="JarInputStream (Java 2 Platform SE v1.4.2)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JarInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM> </TD> </TR>
<TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../java/util/jar/JarFile.html" title="class in java.util.jar"><B>PREV CLASS</B></A> <A HREF="../../../java/util/jar/JarOutputStream.html" title="class in java.util.jar"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="JarInputStream.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_java.util.zip.ZipInputStream">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> java.util.jar</FONT> <BR> Class JarInputStream</H2> <PRE> <A HREF="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../java/io/InputStream.html" title="class in java.io">java.io.InputStream</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../java/io/FilterInputStream.html" title="class in java.io">java.io.FilterInputStream</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../java/util/zip/InflaterInputStream.html" title="class in java.util.zip">java.util.zip.InflaterInputStream</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">java.util.zip.ZipInputStream</A> <IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>java.util.jar.JarInputStream</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.util.zip.ZipConstants</DD> </DL> <HR> <DL> <DT>public class <B>JarInputStream</B><DT>extends <A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></DL> <P> The <code>JarInputStream</code> class is used to read the contents of a JAR file from any input stream. It extends the class <code>java.util.zip.ZipInputStream</code> with support for reading an optional <code>Manifest</code> entry. The <code>Manifest</code> can be used to store meta-information about the JAR file and its entries. JarInputStream类被用来从任意输入流中读取JAR文件的内容,继承自类java.util.zip.ZipInputStream,支持读取可选的Manifest项。 Manifest被用来存储JAR文件及其项的元信息。 <P> <P> <DL> <DT><B>Since:</B></DT> <DD>1.2</DD> <DT><B>See Also:</B><DD><A HREF="../../../java/util/jar/Manifest.html" title="class in java.util.jar"><CODE>Manifest</CODE></A>, <A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip"><CODE>ZipInputStream</CODE></A></DL> <HR> <P> <!-- ======== NESTED CLASS SUMMARY ======== --> <!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Field Summary</B></FONT></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_java.util.zip.ZipInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class java.util.zip.<A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/util/zip/ZipInputStream.html#CENATT">CENATT</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENATX">CENATX</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENCOM">CENCOM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENCRC">CENCRC</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENDSK">CENDSK</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENEXT">CENEXT</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENFLG">CENFLG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENHDR">CENHDR</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENHOW">CENHOW</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENLEN">CENLEN</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENNAM">CENNAM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENOFF">CENOFF</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENSIG">CENSIG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENSIZ">CENSIZ</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENTIM">CENTIM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENVEM">CENVEM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#CENVER">CENVER</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDCOM">ENDCOM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDHDR">ENDHDR</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDOFF">ENDOFF</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDSIG">ENDSIG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDSIZ">ENDSIZ</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDSUB">ENDSUB</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#ENDTOT">ENDTOT</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#EXTCRC">EXTCRC</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#EXTHDR">EXTHDR</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#EXTLEN">EXTLEN</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#EXTSIG">EXTSIG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#EXTSIZ">EXTSIZ</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCCRC">LOCCRC</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCEXT">LOCEXT</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCFLG">LOCFLG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCHDR">LOCHDR</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCHOW">LOCHOW</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCLEN">LOCLEN</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCNAM">LOCNAM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCSIG">LOCSIG</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCSIZ">LOCSIZ</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCTIM">LOCTIM</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#LOCVER">LOCVER</A></CODE></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_java.util.zip.InflaterInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class java.util.zip.<A HREF="../../../java/util/zip/InflaterInputStream.html" title="class in java.util.zip">InflaterInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/util/zip/InflaterInputStream.html#buf">buf</A>, <A HREF="../../../java/util/zip/InflaterInputStream.html#inf">inf</A>, <A HREF="../../../java/util/zip/InflaterInputStream.html#len">len</A></CODE></TD> </TR> </TABLE> <A NAME="fields_inherited_from_class_java.io.FilterInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Fields inherited from class java.io.<A HREF="../../../java/io/FilterInputStream.html" title="class in java.io">FilterInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/io/FilterInputStream.html#in">in</A></CODE></TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#JarInputStream(java.io.InputStream)">JarInputStream</A></B>(<A HREF="../../../java/io/InputStream.html" title="class in java.io">InputStream</A> in)</CODE> <BR> Creates a new <code>JarInputStream</code> and reads the optional manifest. 创建一个JarInputStream,读取可选的声明。</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#JarInputStream(java.io.InputStream, boolean)">JarInputStream</A></B>(<A HREF="../../../java/io/InputStream.html" title="class in java.io">InputStream</A> in, boolean verify)</CODE> <BR> Creates a new <code>JarInputStream</code> and reads the optional manifest. 创建一个JarInputStream,读取可选的声明。</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected <A HREF="../../../java/util/zip/ZipEntry.html" title="class in java.util.zip">ZipEntry</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#createZipEntry(java.lang.String)">createZipEntry</A></B>(<A HREF="../../../java/lang/String.html" title="class in java.lang">String</A> name)</CODE> <BR> Creates a new <code>JarEntry</code> (<code>ZipEntry</code>) for the specified JAR file entry name. 创建一个指定JAR文件项名称的JarEntry(ZipEntry)。</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../java/util/jar/Manifest.html" title="class in java.util.jar">Manifest</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#getManifest()">getManifest</A></B>()</CODE> <BR> Returns the <code>Manifest</code> for this JAR file, or <code>null</code> if none. 返回此JAR文件的Manifest,如果没有返回null。</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../java/util/zip/ZipEntry.html" title="class in java.util.zip">ZipEntry</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#getNextEntry()">getNextEntry</A></B>()</CODE> <BR> Reads the next ZIP file entry and positions stream at the beginning of the entry data. 读取下一个ZIP文件项,并把流定位在项数据的开始位置。</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../java/util/jar/JarEntry.html" title="class in java.util.jar">JarEntry</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#getNextJarEntry()">getNextJarEntry</A></B>()</CODE> <BR> Reads the next JAR file entry and positions the stream at the beginning of the entry data. 读取下一个JAR文件项,并把流定位在项数据的开始位置。</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../java/util/jar/JarInputStream.html#read(byte[], int, int)">read</A></B>(byte[] b, int off, int len)</CODE> <BR> Reads from the current JAR file entry into an array of bytes. 从当前的JAR文件项读入字节数组。</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.util.zip.ZipInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.util.zip.<A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/util/zip/ZipInputStream.html#available()">available</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#close()">close</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#closeEntry()">closeEntry</A>, <A HREF="../../../java/util/zip/ZipInputStream.html#skip(long)">skip</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.util.zip.InflaterInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.util.zip.<A HREF="../../../java/util/zip/InflaterInputStream.html" title="class in java.util.zip">InflaterInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/util/zip/InflaterInputStream.html#fill()">fill</A>, <A HREF="../../../java/util/zip/InflaterInputStream.html#read()">read</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.io.FilterInputStream"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.io.<A HREF="../../../java/io/FilterInputStream.html" title="class in java.io">FilterInputStream</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/io/FilterInputStream.html#mark(int)">mark</A>, <A HREF="../../../java/io/FilterInputStream.html#markSupported()">markSupported</A>, <A HREF="../../../java/io/FilterInputStream.html#read(byte[])">read</A>, <A HREF="../../../java/io/FilterInputStream.html#reset()">reset</A></CODE></TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></B></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../java/lang/Object.html#clone()">clone</A>, <A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#finalize()">finalize</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TD> </TR> </TABLE> <A NAME="JarInputStream(java.io.InputStream)"><!-- --></A><H3> JarInputStream</H3> <PRE> public <B>JarInputStream</B>(<A HREF="../../../java/io/InputStream.html" title="class in java.io">InputStream</A> in) throws <A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></PRE> <DL> <DD>Creates a new <code>JarInputStream</code> and reads the optional manifest. If a manifest is present, also attempts to verify the signatures if the JarInputStream is signed. 创建一个JarInputStream,读取可选的声明。如果声明存在,JarInputStream被签名,则核实签名。 <P> <DT><B>Parameters:</B><DD><CODE>in</CODE> - the actual input stream 实际的输入流 <DT><B>Throws:</B> <DD><CODE><A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error has occurred 如果发生I/O错误时抛出</DL> <HR> <A NAME="JarInputStream(java.io.InputStream, boolean)"><!-- --></A><H3> JarInputStream</H3> <PRE> public <B>JarInputStream</B>(<A HREF="../../../java/io/InputStream.html" title="class in java.io">InputStream</A> in, boolean verify) throws <A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></PRE> <DL> <DD>Creates a new <code>JarInputStream</code> and reads the optional manifest. If a manifest is present and verify is true, also attempts to verify the signatures if the JarInputStream is signed. 创建一个JarInputStream,读取可选的声明。如果声明存在,verify为true,JarInputStream被签名,则核实签名。 <P> <DT><B>Parameters:</B><DD><CODE>in</CODE> - the actual input stream<DD><CODE>verify</CODE> - whether or not to verify the JarInputStream if it is signed. 如果JarInputStream被签名,是否核实。 <DT><B>Throws:</B> <DD><CODE><A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error has occurred 如果发生I/O错误时抛出</DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="getManifest()"><!-- --></A><H3> getManifest</H3> <PRE> public <A HREF="../../../java/util/jar/Manifest.html" title="class in java.util.jar">Manifest</A> <B>getManifest</B>()</PRE> <DL> <DD>Returns the <code>Manifest</code> for this JAR file, or <code>null</code> if none. 返回此JAR文件的Manifest,如果没有返回null。 <P> <DD><DL> <DT><B>Returns:</B><DD>the <code>Manifest</code> for this JAR file, or <code>null</code> if none. 此JAR文件的Manifest,如果没有返回null。</DL> </DD> </DL> <HR> <A NAME="getNextEntry()"><!-- --></A><H3> getNextEntry</H3> <PRE> public <A HREF="../../../java/util/zip/ZipEntry.html" title="class in java.util.zip">ZipEntry</A> <B>getNextEntry</B>() throws <A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></PRE> <DL> <DD>Reads the next ZIP file entry and positions stream at the beginning of the entry data. 读取下一个ZIP文件项,并把流定位在项数据的开始位置。 <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/util/zip/ZipInputStream.html#getNextEntry()">getNextEntry</A></CODE> in class <CODE><A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>the ZipEntry just read 刚刚读入的ZipEntry <DT><B>Throws:</B> <DD><CODE><A HREF="../../../java/util/zip/ZipException.html" title="class in java.util.zip">ZipException</A></CODE> - if a ZIP file error has occurred 如果发生ZIP文件错误时抛出 <DD><CODE><A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error has occurred 如果发生I/O错误时抛出</DL> </DD> </DL> <HR> <A NAME="getNextJarEntry()"><!-- --></A><H3> getNextJarEntry</H3> <PRE> public <A HREF="../../../java/util/jar/JarEntry.html" title="class in java.util.jar">JarEntry</A> <B>getNextJarEntry</B>() throws <A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></PRE> <DL> <DD>Reads the next JAR file entry and positions the stream at the beginning of the entry data. 读取下一个JAR文件项,并把流定位在项数据的开始位置。 <P> <DD><DL> <DT><B>Returns:</B><DD>the next JAR file entry 下一个JAR文件项 <DT><B>Throws:</B> <DD><CODE><A HREF="../../../java/util/zip/ZipException.html" title="class in java.util.zip">ZipException</A></CODE> - if a ZIP file error has occurred 如果发生ZIP文件错误时抛出 <DD><CODE><A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error has occurred 如果发生I/O错误时抛出</DL> </DD> </DL> <HR> <A NAME="read(byte[], int, int)"><!-- --></A><H3> read</H3> <PRE> public int <B>read</B>(byte[] b, int off, int len) throws <A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></PRE> <DL> <DD>Reads from the current JAR file entry into an array of bytes. Blocks until some input is available. 从当前的JAR文件项读入字节数组。阻塞直到输入可利用。 <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/util/zip/ZipInputStream.html#read(byte[], int, int)">read</A></CODE> in class <CODE><A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>b</CODE> - the buffer into which the data is read 数据读入的缓冲区<DD><CODE>off</CODE> - the start offset of the data 数据的起始偏移<DD><CODE>len</CODE> - the maximum number of bytes to read 读入字节的最大数量 <DT><B>Returns:</B><DD>the actual number of bytes read, or -1 if the end of the entry is reached 读入的实际字节数,如果到达该项末端,返回-1 <DT><B>Throws:</B> <DD><CODE><A HREF="../../../java/util/zip/ZipException.html" title="class in java.util.zip">ZipException</A></CODE> - if a ZIP file error has occurred 如果发生ZIP文件错误时抛出 <DD><CODE><A HREF="../../../java/io/IOException.html" title="class in java.io">IOException</A></CODE> - if an I/O error has occurred 如果发生I/O错误时抛出</DL> </DD> </DL> <HR> <A NAME="createZipEntry(java.lang.String)"><!-- --></A><H3> createZipEntry</H3> <PRE> protected <A HREF="../../../java/util/zip/ZipEntry.html" title="class in java.util.zip">ZipEntry</A> <B>createZipEntry</B>(<A HREF="../../../java/lang/String.html" title="class in java.lang">String</A> name)</PRE> <DL> <DD>Creates a new <code>JarEntry</code> (<code>ZipEntry</code>) for the specified JAR file entry name. 创建一个指定JAR文件项名称的JarEntry(ZipEntry)。 <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE><A HREF="../../../java/util/zip/ZipInputStream.html#createZipEntry(java.lang.String)">createZipEntry</A></CODE> in class <CODE><A HREF="../../../java/util/zip/ZipInputStream.html" title="class in java.util.zip">ZipInputStream</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the JAR/ZIP file entry JAR/ZIP文件项的名称 <DT><B>Returns:</B><DD>the <code>JarEntry</code> object just created 刚创建的JarEntry对象</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JarInputStream.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> <b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.4.2</b></EM> </TD> </TR>
<TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../java/util/jar/JarFile.html" title="class in java.util.jar"><B>PREV CLASS</B></A> <A HREF="../../../java/util/jar/JarOutputStream.html" title="class in java.util.jar"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="JarInputStream.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_java.util.zip.ZipInputStream">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <font size="-1"><a href="http://java.sun.com/cgi-bin/bugreport.cgi">Submit a bug or feature</a><br>For further API reference and developer documentation, see <a href="../../../../relnotes/devdocs-vs-specs.html">Java 2 SDK SE Developer Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../../../../relnotes/license.html">license terms</a>. Also see the <a href="http://java.sun.com/docs/redist.html">documentation redistribution policy</a>.</font> </BODY> </HTML>

|