src/share/classes/java/nio/Buffer.java

Print this page

        

@@ -23,10 +23,11 @@
  * questions.
  */
 
 package java.nio;
 
+import java.util.Spliterator;
 
 /**
  * A container for data of a specific primitive type.
  *
  * <p> A buffer is a linear, finite sequence of elements of a specific

@@ -171,10 +172,17 @@
  * @since 1.4
  */
 
 public abstract class Buffer {
 
+    /**
+     * The characteristics of Spliterators that traverse and split elements
+     * maintained in Buffers.
+     */
+    static final int SPLITERATOR_CHARACTERISTICS =
+        Spliterator.SIZED | Spliterator.SUBSIZED | Spliterator.ORDERED;
+
     // Invariants: mark <= position <= limit <= capacity
     private int mark = -1;
     private int position = 0;
     private int limit;
     private int capacity;