< prev index next >

src/java.base/share/classes/java/util/zip/ZipInputStream.java

Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea

*** 108,119 **** /** * Reads the next ZIP file entry and positions the stream at the * beginning of the entry data. * @return the next ZIP file entry, or null if there are no more entries ! * @exception ZipException if a ZIP file error has occurred ! * @exception IOException if an I/O error has occurred */ public ZipEntry getNextEntry() throws IOException { ensureOpen(); if (entry != null) { closeEntry(); --- 108,119 ---- /** * Reads the next ZIP file entry and positions the stream at the * beginning of the entry data. * @return the next ZIP file entry, or null if there are no more entries ! * @throws ZipException if a ZIP file error has occurred ! * @throws IOException if an I/O error has occurred */ public ZipEntry getNextEntry() throws IOException { ensureOpen(); if (entry != null) { closeEntry();
*** 131,142 **** } /** * Closes the current ZIP entry and positions the stream for reading the * next entry. ! * @exception ZipException if a ZIP file error has occurred ! * @exception IOException if an I/O error has occurred */ public void closeEntry() throws IOException { ensureOpen(); while (read(tmpbuf, 0, tmpbuf.length) != -1) ; entryEOF = true; --- 131,142 ---- } /** * Closes the current ZIP entry and positions the stream for reading the * next entry. ! * @throws ZipException if a ZIP file error has occurred ! * @throws IOException if an I/O error has occurred */ public void closeEntry() throws IOException { ensureOpen(); while (read(tmpbuf, 0, tmpbuf.length) != -1) ; entryEOF = true;
*** 148,158 **** * <p> * Programs should not count on this method to return the actual number * of bytes that could be read without blocking. * * @return 1 before EOF and 0 after EOF has reached for current entry. ! * @exception IOException if an I/O error occurs. * */ public int available() throws IOException { ensureOpen(); if (entryEOF) { --- 148,158 ---- * <p> * Programs should not count on this method to return the actual number * of bytes that could be read without blocking. * * @return 1 before EOF and 0 after EOF has reached for current entry. ! * @throws IOException if an I/O error occurs. * */ public int available() throws IOException { ensureOpen(); if (entryEOF) {
*** 170,185 **** * @param b the buffer into which the data is read * @param off the start offset in the destination array <code>b</code> * @param len the maximum number of bytes read * @return the actual number of bytes read, or -1 if the end of the * entry is reached ! * @exception NullPointerException if <code>b</code> is <code>null</code>. ! * @exception IndexOutOfBoundsException if <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> ! * @exception ZipException if a ZIP file error has occurred ! * @exception IOException if an I/O error has occurred */ public int read(byte[] b, int off, int len) throws IOException { ensureOpen(); if (off < 0 || len < 0 || off > b.length - len) { throw new IndexOutOfBoundsException(); --- 170,185 ---- * @param b the buffer into which the data is read * @param off the start offset in the destination array <code>b</code> * @param len the maximum number of bytes read * @return the actual number of bytes read, or -1 if the end of the * entry is reached ! * @throws NullPointerException if <code>b</code> is <code>null</code>. ! * @throws IndexOutOfBoundsException if <code>off</code> is negative, * <code>len</code> is negative, or <code>len</code> is greater than * <code>b.length - off</code> ! * @throws ZipException if a ZIP file error has occurred ! * @throws IOException if an I/O error has occurred */ public int read(byte[] b, int off, int len) throws IOException { ensureOpen(); if (off < 0 || len < 0 || off > b.length - len) { throw new IndexOutOfBoundsException();
*** 229,241 **** /** * Skips specified number of bytes in the current ZIP entry. * @param n the number of bytes to skip * @return the actual number of bytes skipped ! * @exception ZipException if a ZIP file error has occurred ! * @exception IOException if an I/O error has occurred ! * @exception IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("negative skip length"); } --- 229,241 ---- /** * Skips specified number of bytes in the current ZIP entry. * @param n the number of bytes to skip * @return the actual number of bytes skipped ! * @throws ZipException if a ZIP file error has occurred ! * @throws IOException if an I/O error has occurred ! * @throws IllegalArgumentException if {@code n < 0} */ public long skip(long n) throws IOException { if (n < 0) { throw new IllegalArgumentException("negative skip length"); }
*** 258,268 **** } /** * Closes this input stream and releases any system resources associated * with the stream. ! * @exception IOException if an I/O error has occurred */ public void close() throws IOException { if (!closed) { super.close(); closed = true; --- 258,268 ---- } /** * Closes this input stream and releases any system resources associated * with the stream. ! * @throws IOException if an I/O error has occurred */ public void close() throws IOException { if (!closed) { super.close(); closed = true;
< prev index next >