src/java.base/share/classes/java/util/jar/JarFile.java
Print this page
*** 35,45 ****
import java.security.CodeSigner;
import java.security.cert.Certificate;
import java.security.AccessController;
import java.security.CodeSource;
import jdk.internal.misc.SharedSecrets;
- import sun.misc.IOUtils;
import sun.security.action.GetPropertyAction;
import sun.security.util.ManifestEntryVerifier;
import sun.security.util.SignatureFileVerifier;
/**
--- 35,44 ----
*** 436,446 ****
* Reads all the bytes for a given entry. Used to process the
* META-INF files.
*/
private byte[] getBytes(ZipEntry ze) throws IOException {
try (InputStream is = super.getInputStream(ze)) {
! return IOUtils.readFully(is, (int)ze.getSize(), true);
}
}
/**
* Returns an input stream for reading the contents of the specified
--- 435,450 ----
* Reads all the bytes for a given entry. Used to process the
* META-INF files.
*/
private byte[] getBytes(ZipEntry ze) throws IOException {
try (InputStream is = super.getInputStream(ze)) {
! int len = (int)ze.getSize();
! byte[] b = is.readAllBytes();
! if (len != -1 && b.length != len)
! throw new EOFException("Expected:" + len + ", read:" + b.length);
!
! return b;
}
}
/**
* Returns an input stream for reading the contents of the specified