< prev index next >

src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template

Print this page




 127 #if[rw]
 128         return new Heap$Type$BufferR(hb,
 129                                      this.markValue(),
 130                                      this.position(),
 131                                      this.limit(),
 132                                      this.capacity(),
 133                                      offset);
 134 #else[rw]
 135         return duplicate();
 136 #end[rw]
 137     }
 138 
 139 #if[rw]
 140 
 141     protected int ix(int i) {
 142         return i + offset;
 143     }
 144 
 145 #if[byte]
 146     private long byteOffset(long i) {
 147         return arrayBaseOffset + i + offset;
 148     }
 149 #end[byte]
 150 
 151     public $type$ get() {
 152         return hb[ix(nextGetIndex())];
 153     }
 154 
 155     public $type$ get(int i) {
 156         return hb[ix(checkIndex(i))];
 157     }
 158 
 159 #if[streamableType]
 160     $type$ getUnchecked(int i) {
 161         return hb[ix(i)];
 162     }
 163 #end[streamableType]
 164 
 165     public $Type$Buffer get($type$[] dst, int offset, int length) {
 166         checkBounds(offset, length, dst.length);
 167         if (length > remaining())




 127 #if[rw]
 128         return new Heap$Type$BufferR(hb,
 129                                      this.markValue(),
 130                                      this.position(),
 131                                      this.limit(),
 132                                      this.capacity(),
 133                                      offset);
 134 #else[rw]
 135         return duplicate();
 136 #end[rw]
 137     }
 138 
 139 #if[rw]
 140 
 141     protected int ix(int i) {
 142         return i + offset;
 143     }
 144 
 145 #if[byte]
 146     private long byteOffset(long i) {
 147         return (arrayBaseOffset >> 1) + i + offset;
 148     }
 149 #end[byte]
 150 
 151     public $type$ get() {
 152         return hb[ix(nextGetIndex())];
 153     }
 154 
 155     public $type$ get(int i) {
 156         return hb[ix(checkIndex(i))];
 157     }
 158 
 159 #if[streamableType]
 160     $type$ getUnchecked(int i) {
 161         return hb[ix(i)];
 162     }
 163 #end[streamableType]
 164 
 165     public $Type$Buffer get($type$[] dst, int offset, int length) {
 166         checkBounds(offset, length, dst.length);
 167         if (length > remaining())


< prev index next >