< prev index next >

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

Print this page

        

*** 502,522 **** 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 * 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); } else { return device.openStream(); } } }); --- 502,523 ---- seedStream = java.security.AccessController.doPrivileged (new java.security.PrivilegedExceptionAction<InputStream>() { @Override public InputStream run() throws IOException { /* ! * return a shared InputStream from FileInputStreamPool ! * 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 FileInputStreamPool.getInputStream(deviceFile); } else { return device.openStream(); } } });
< prev index next >