changeset 755:6eec8be80bfe

6405891: MLet: could be improved to load a native lib Reviewed-by: emcmanus
author sjiang
date Tue, 09 Dec 2008 17:41:04 +0100
parents 4e0e690373fc
children 30239cf868b0
files src/share/classes/javax/management/loading/MLet.java
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/javax/management/loading/MLet.java	Tue Dec 02 14:53:52 2008 -0800
+++ b/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();