--- a/jdk/src/share/classes/javax/management/loading/MLet.java Tue Dec 02 14:53:52 2008 -0800
+++ b/jdk/src/share/classes/javax/management/loading/MLet.java Tue Dec 09 17:41:04 2008 +0100
@@ -1165,9 +1165,10 @@
file.deleteOnExit();
FileOutputStream fileOutput = new FileOutputStream(file);
try {
- int c;
- while ((c = is.read()) != -1) {
- fileOutput.write(c);
+ byte[] buf = new byte[4096];
+ int n;
+ while ((n = is.read(buf)) >= 0) {
+ fileOutput.write(buf, 0, n);
}
} finally {
fileOutput.close();