src/java.desktop/share/classes/sun/applet/AppletClassLoader.java
Print this page
*** 31,40 ****
--- 31,41 ----
import java.net.SocketPermission;
import java.net.URLConnection;
import java.net.MalformedURLException;
import java.net.InetAddress;
import java.net.UnknownHostException;
+ import java.io.EOFException;
import java.io.File;
import java.io.FilePermission;
import java.io.IOException;
import java.io.BufferedInputStream;
import java.io.InputStream;
*** 49,59 ****
import java.security.CodeSource;
import java.security.Permission;
import java.security.PermissionCollection;
import sun.awt.AppContext;
import sun.awt.SunToolkit;
- import sun.misc.IOUtils;
import sun.misc.ManagedLocalsThread;
import sun.net.www.ParseUtil;
import sun.security.util.SecurityConstants;
/**
--- 50,59 ----
*** 332,342 ****
// Use buffered input stream [stanleyh]
InputStream in = new BufferedInputStream(uc.getInputStream());
byte[] b;
try {
! b = IOUtils.readFully(in, len, true);
} finally {
in.close();
}
return b;
}
--- 332,344 ----
// Use buffered input stream [stanleyh]
InputStream in = new BufferedInputStream(uc.getInputStream());
byte[] b;
try {
! b = in.readAllBytes();
! if (len != -1 && b.length != len)
! throw new EOFException("Expected:" + len + ", read:" + b.length);
} finally {
in.close();
}
return b;
}