[12] 8193822: Remove unused newDirectByteBuffer and truncate methods from buffer classes

Brian Burkhalter brian.burkhalter at oracle.com
Wed Aug 8 14:45:35 UTC 2018


https://bugs.openjdk.java.net/browse/JDK-8193822

Diff included below (excluding copyright year update).

Thanks,

Brian

--- a/src/java.base/share/classes/java/nio/Buffer.java
+++ b/src/java.base/share/classes/java/nio/Buffer.java
@@ -717,14 +717,6 @@
                 public JavaNioAccess.BufferPool getDirectBufferPool() {
                     return Bits.BUFFER_POOL;
                 }
-                @Override
-                public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) {
-                    return new DirectByteBuffer(addr, cap, ob);
-                }
-                @Override
-                public void truncate(Buffer buf) {
-                    buf.truncate();
-                }
             });
     }
 
--- a/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java
+++ b/src/java.base/share/classes/jdk/internal/misc/JavaNioAccess.java
@@ -39,18 +39,4 @@
         long getMemoryUsed();
     }
     BufferPool getDirectBufferPool();
-
-    /**
-     * Constructs a direct ByteBuffer referring to the block of memory starting
-     * at the given memory address and extending {@code cap} bytes.
-     * The {@code ob} parameter is an arbitrary object that is attached
-     * to the resulting buffer.
-     */
-    ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob);
-
-    /**
-     * Truncates a buffer by changing its capacity to 0.
-     */
-    void truncate(Buffer buf);
-
 }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20180808/8027805d/attachment.html>


More information about the nio-dev mailing list