• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.  Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26#warn This file is preprocessed before being compiled
27
28class XXX {
29
30#begin
31
32    /**
33     * Relative <i>get</i> method for reading $a$ $type$ value.
34     *
35     * <p> Reads the next $nbytes$ bytes at this buffer's current position,
36     * composing them into $a$ $type$ value according to the current byte order,
37     * and then increments the position by $nbytes$.  </p>
38     *
39     * @return  The $type$ value at the buffer's current position
40     *
41     * @throws  BufferUnderflowException
42     *          If there are fewer than $nbytes$ bytes
43     *          remaining in this buffer
44     */
45    public abstract $type$ get$Type$();
46
47    /**
48     * Relative <i>put</i> method for writing $a$ $type$
49     * value&nbsp;&nbsp;<i>(optional operation)</i>.
50     *
51     * <p> Writes $nbytes$ bytes containing the given $type$ value, in the
52     * current byte order, into this buffer at the current position, and then
53     * increments the position by $nbytes$.  </p>
54     *
55     * @param  value
56     *         The $type$ value to be written
57     *
58     * @return  This buffer
59     *
60     * @throws  BufferOverflowException
61     *          If there are fewer than $nbytes$ bytes
62     *          remaining in this buffer
63     *
64     * @throws  ReadOnlyBufferException
65     *          If this buffer is read-only
66     */
67    public abstract ByteBuffer put$Type$($type$ value);
68
69    /**
70     * Absolute <i>get</i> method for reading $a$ $type$ value.
71     *
72     * <p> Reads $nbytes$ bytes at the given index, composing them into a
73     * $type$ value according to the current byte order.  </p>
74     *
75     * @param  index
76     *         The index from which the bytes will be read
77     *
78     * @return  The $type$ value at the given index
79     *
80     * @throws  IndexOutOfBoundsException
81     *          If {@code index} is negative
82     *          or not smaller than the buffer's limit,
83     *          minus $nbytesButOne$
84     */
85    public abstract $type$ get$Type$(int index);
86
87    // BEGIN Android-added: {get,put}*Unchecked() accessors.
88    abstract $type$ get$Type$Unchecked(int index);
89    abstract void getUnchecked(int pos, $type$[] dst, int dstOffset, int length);
90    // END Android-added: {get,put}*Unchecked() accessors.
91
92    /**
93     * Absolute <i>put</i> method for writing $a$ $type$
94     * value&nbsp;&nbsp;<i>(optional operation)</i>.
95     *
96     * <p> Writes $nbytes$ bytes containing the given $type$ value, in the
97     * current byte order, into this buffer at the given index.  </p>
98     *
99     * @param  index
100     *         The index at which the bytes will be written
101     *
102     * @param  value
103     *         The $type$ value to be written
104     *
105     * @return  This buffer
106     *
107     * @throws  IndexOutOfBoundsException
108     *          If {@code index} is negative
109     *          or not smaller than the buffer's limit,
110     *          minus $nbytesButOne$
111     *
112     * @throws  ReadOnlyBufferException
113     *          If this buffer is read-only
114     */
115    public abstract ByteBuffer put$Type$(int index, $type$ value);
116
117    // BEGIN Android-added: {get,put}*Unchecked() accessors.
118    abstract void put$Type$Unchecked(int index, $type$ value);
119    abstract void putUnchecked(int pos, $type$[] dst, int srcOffset, int length);
120    // END Android-added: {get,put}*Unchecked() accessors.
121
122    /**
123     * Creates a view of this byte buffer as $a$ $type$ buffer.
124     *
125     * <p> The content of the new buffer will start at this buffer's current
126     * position.  Changes to this buffer's content will be visible in the new
127     * buffer, and vice versa; the two buffers' position, limit, and mark
128     * values will be independent.
129     *
130     * <p> The new buffer's position will be zero, its capacity and its limit
131     * will be the number of bytes remaining in this buffer divided by
132     * $nbytes$, its mark will be undefined, and its byte order will be that
133     * of the byte buffer at the moment the view is created.  The new buffer
134     * will be direct if, and only if, this buffer is direct, and it will be
135     * read-only if, and only if, this buffer is read-only.  </p>
136     *
137     * @return  A new $type$ buffer
138     */
139    public abstract $Type$Buffer as$Type$Buffer();
140
141#end
142
143}
144