< prev index next >

src/java.base/share/classes/sun/nio/ch/Util.java

Print this page

        

@@ -413,11 +413,12 @@
                         Class<?> cl = Class.forName("java.nio.DirectByteBuffer");
                         Constructor<?> ctor = cl.getDeclaredConstructor(
                             new Class<?>[] { int.class,
                                              long.class,
                                              FileDescriptor.class,
-                                             Runnable.class });
+                                             Runnable.class,
+                                             boolean.class });
                         ctor.setAccessible(true);
                         directByteBufferConstructor = ctor;
                     } catch (ClassNotFoundException   |
                              NoSuchMethodException    |
                              IllegalArgumentException |

@@ -428,21 +429,23 @@
                 }});
     }
 
     static MappedByteBuffer newMappedByteBuffer(int size, long addr,
                                                 FileDescriptor fd,
-                                                Runnable unmapper)
+                                                Runnable unmapper,
+                                                boolean isPersistent)
     {
         MappedByteBuffer dbb;
         if (directByteBufferConstructor == null)
             initDBBConstructor();
         try {
             dbb = (MappedByteBuffer)directByteBufferConstructor.newInstance(
               new Object[] { size,
                              addr,
                              fd,
-                             unmapper });
+                             unmapper,
+                             isPersistent});
         } catch (InstantiationException |
                  IllegalAccessException |
                  InvocationTargetException e) {
             throw new InternalError(e);
         }

@@ -458,11 +461,12 @@
                         Class<?> cl = Class.forName("java.nio.DirectByteBufferR");
                         Constructor<?> ctor = cl.getDeclaredConstructor(
                             new Class<?>[] { int.class,
                                              long.class,
                                              FileDescriptor.class,
-                                             Runnable.class });
+                                             Runnable.class,
+                                             boolean.class });
                         ctor.setAccessible(true);
                         directByteBufferRConstructor = ctor;
                     } catch (ClassNotFoundException |
                              NoSuchMethodException |
                              IllegalArgumentException |

@@ -473,21 +477,23 @@
                 }});
     }
 
     static MappedByteBuffer newMappedByteBufferR(int size, long addr,
                                                  FileDescriptor fd,
-                                                 Runnable unmapper)
+                                                 Runnable unmapper,
+                                                 boolean isPersistent)
     {
         MappedByteBuffer dbb;
         if (directByteBufferRConstructor == null)
             initDBBRConstructor();
         try {
             dbb = (MappedByteBuffer)directByteBufferRConstructor.newInstance(
               new Object[] { size,
                              addr,
                              fd,
-                             unmapper });
+                             unmapper,
+                             isPersistent});
         } catch (InstantiationException |
                  IllegalAccessException |
                  InvocationTargetException e) {
             throw new InternalError(e);
         }
< prev index next >