< prev index next >

src/java.base/share/classes/sun/security/provider/SeedGenerator.java

Print this page

        

@@ -502,21 +502,23 @@
                 seedStream = java.security.AccessController.doPrivileged
                     (new java.security.PrivilegedExceptionAction<InputStream>() {
                         @Override
                         public InputStream run() throws IOException {
                             /*
-                             * return a FileInputStream for file URLs and
-                             * avoid buffering. The openStream() call wraps
-                             * InputStream in a BufferedInputStream which
+                             * return a shared InputStream for file URLs and
+                             * avoid buffering.
+                             * The URL.openStream() call wraps InputStream in a
+                             * BufferedInputStream which
                              * can buffer up to 8K bytes. This read is a
                              * performance issue for entropy sources which
                              * can be slow to replenish.
                              */
                             if (device.getProtocol().equalsIgnoreCase("file")) {
                                 File deviceFile =
                                     SunEntries.getDeviceFile(device);
-                                return new FileInputStream(deviceFile);
+                                return FileInputStreamPool
+                                    .getInputStream(deviceFile);
                             } else {
                                 return device.openStream();
                             }
                         }
                     });
< prev index next >