6405891: MLet: could be improved to load a native lib
authorsjiang
Tue, 09 Dec 2008 17:41:04 +0100
changeset 1703 a28fa559929a
parent 1692 92165aa9df3e
child 1704 d2b5c71d8771
6405891: MLet: could be improved to load a native lib Reviewed-by: emcmanus
jdk/src/share/classes/javax/management/loading/MLet.java
--- 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();