equal
deleted
inserted
replaced
28 package java.nio; |
28 package java.nio; |
29 |
29 |
30 #if[char] |
30 #if[char] |
31 import java.io.IOException; |
31 import java.io.IOException; |
32 #end[char] |
32 #end[char] |
|
33 #if[streamableType] |
|
34 import java.util.Spliterator; |
|
35 import java.util.stream.StreamSupport; |
|
36 import java.util.stream.$Streamtype$Stream; |
|
37 #end[streamableType] |
33 |
38 |
34 /** |
39 /** |
35 * $A$ $type$ buffer. |
40 * $A$ $type$ buffer. |
36 * |
41 * |
37 * <p> This class defines {#if[byte]?six:four} categories of operations upon |
42 * <p> This class defines {#if[byte]?six:four} categories of operations upon |
587 * If <tt>index</tt> is negative |
592 * If <tt>index</tt> is negative |
588 * or not smaller than the buffer's limit |
593 * or not smaller than the buffer's limit |
589 */ |
594 */ |
590 public abstract $type$ get(int index); |
595 public abstract $type$ get(int index); |
591 |
596 |
|
597 #if[streamableType] |
|
598 /** |
|
599 * Absolute <i>get</i> method. Reads the $type$ at the given |
|
600 * index without any validation of the index. |
|
601 * |
|
602 * @param index |
|
603 * The index from which the $type$ will be read |
|
604 * |
|
605 * @return The $type$ at the given index |
|
606 */ |
|
607 abstract $type$ getUnchecked(int index); // package-private |
|
608 #end[streamableType] |
|
609 |
592 /** |
610 /** |
593 * Absolute <i>put</i> method <i>(optional operation)</i>. |
611 * Absolute <i>put</i> method <i>(optional operation)</i>. |
594 * |
612 * |
595 * <p> Writes the given $type$ into this buffer at the given |
613 * <p> Writes the given $type$ into this buffer at the given |
596 * index. </p> |
614 * index. </p> |
1456 // Binary-data access methods for short, char, int, long, float, |
1474 // Binary-data access methods for short, char, int, long, float, |
1457 // and double will be inserted here |
1475 // and double will be inserted here |
1458 |
1476 |
1459 #end[byte] |
1477 #end[byte] |
1460 |
1478 |
|
1479 #if[streamableType] |
|
1480 |
|
1481 #if[char] |
|
1482 @Override |
|
1483 #end[char] |
|
1484 public $Streamtype$Stream $type$s() { |
|
1485 return StreamSupport.$streamtype$Stream(() -> new $Type$BufferSpliterator(this), |
|
1486 Buffer.SPLITERATOR_CHARACTERISTICS); |
|
1487 } |
|
1488 |
|
1489 #end[streamableType] |
|
1490 |
1461 } |
1491 } |