ByteBufferAs-X-Buffer.java.template revision 2362
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling * This code is free software; you can redistribute it and/or modify it
441d80aa4f613b6298fc8bd3151f4be02dbf84fclling * under the terms of the GNU General Public License version 2 only, as
fa9e4066f08beec538e775443c5be79dd423fcabahrens * published by the Free Software Foundation. Oracle designates this
fa9e4066f08beec538e775443c5be79dd423fcabahrens * particular file as subject to the "Classpath" exception as provided
fa9e4066f08beec538e775443c5be79dd423fcabahrens * by Oracle in the LICENSE file that accompanied this code.
fa9e4066f08beec538e775443c5be79dd423fcabahrens * This code is distributed in the hope that it will be useful, but WITHOUT
fa9e4066f08beec538e775443c5be79dd423fcabahrens * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fa9e4066f08beec538e775443c5be79dd423fcabahrens * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fa9e4066f08beec538e775443c5be79dd423fcabahrens * version 2 for more details (a copy is included in the LICENSE file that
fa9e4066f08beec538e775443c5be79dd423fcabahrens * accompanied this code).
fa9e4066f08beec538e775443c5be79dd423fcabahrens * You should have received a copy of the GNU General Public License version
fa9e4066f08beec538e775443c5be79dd423fcabahrens * 2 along with this work; if not, write to the Free Software Foundation,
fa9e4066f08beec538e775443c5be79dd423fcabahrens * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f94275ce205810a201404c5f35f4cc96057022b1Adam Leventhal * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
fa9e4066f08beec538e775443c5be79dd423fcabahrens * or visit www.oracle.com if you need additional information or have any
fa9e4066f08beec538e775443c5be79dd423fcabahrensclass ByteBufferAs$Type$Buffer$RW$$BO$ // package-private
fa9e4066f08beec538e775443c5be79dd423fcabahrens extends {#if[ro]?ByteBufferAs}$Type$Buffer{#if[ro]?$BO$}
fa9e4066f08beec538e775443c5be79dd423fcabahrens protected final int offset;
fa9e4066f08beec538e775443c5be79dd423fcabahrens ByteBufferAs$Type$Buffer$RW$$BO$(ByteBuffer bb) { // package-private
fa9e4066f08beec538e775443c5be79dd423fcabahrens // enforce limit == capacity
fa9e4066f08beec538e775443c5be79dd423fcabahrens return new ByteBufferAs$Type$Buffer$RW$$BO$(bb, -1, 0, rem, rem, off);
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw protected int ix(int i) {
74e7dc986c89efca1f2e4451c7a572e05e4a6e4fMatthew Ahrens return Bits.get$Type$$BO$(bb, ix(checkIndex(i)));
1d7132005da8d75994a6ad204e6ec05ef5ffaa4bEric Schrock return this;
fa9e4066f08beec538e775443c5be79dd423fcabahrens return this;
990b4856d0eaada6f8140335733a1b1771ed2746lling return this;
2f8aaab38e6371ad39ed90a1211ba8921acbb4d5eschrock public boolean isDirect() {
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick public boolean isReadOnly() {
b24ab6762772a3f6a89393947930c7fa61306783Jeff Bonwick return {#if[rw]?false:true};
92241e0b80813d0b83c08e730a29b9d1831794fcTom Erickson // --- Methods to support CharSequence ---
92241e0b80813d0b83c08e730a29b9d1831794fcTom Erickson if ((start < 0) || (end > len) || (start > end))