1 /* MappedByteBufferImpl.java --
2 Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
41 import java.io.IOException;
42 import java.nio.channels.FileChannelImpl;
43 import gnu.gcj.RawData;
45 public class MappedByteBufferImpl extends MappedByteBuffer
49 public FileChannelImpl ch;
51 public MappedByteBufferImpl (FileChannelImpl ch) throws IOException
53 super ((int) ch.size (), (int) ch.size (), 0, -1);
56 map_address = ch.map_address;
57 long si = ch.size () / 1;
61 public boolean isReadOnly ()
66 public static byte getImpl (FileChannelImpl ch, int index,
67 int limit, RawData map_address)
69 throw new Error ("Not implemented");
72 public static void putImpl (FileChannelImpl ch, int index,
73 int limit, byte value, RawData map_address)
75 throw new Error ("Not implemented");
80 byte result = get (position());
81 position (position() + 1);
85 public ByteBuffer put (byte value)
87 put (position(), value);
88 position (position() + 1);
92 public byte get (int index)
94 return getImpl (ch, index, limit (), map_address);
97 public ByteBuffer put (int index, byte value)
99 putImpl (ch, index, limit (), value, map_address);
103 public ByteBuffer compact ()
105 throw new Error ("Not implemented");
108 public boolean isDirect ()
113 public ByteBuffer slice ()
115 throw new Error ("Not implemented");
118 public ByteBuffer duplicate ()
120 throw new Error ("Not implemented");
123 public ByteBuffer asReadOnlyBuffer ()
125 throw new Error ("Not implemented");
128 public CharBuffer asCharBuffer ()
130 return new CharViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
133 public ShortBuffer asShortBuffer ()
135 return new ShortViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
138 public IntBuffer asIntBuffer ()
140 return new IntViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
143 public LongBuffer asLongBuffer ()
145 return new LongViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
148 public FloatBuffer asFloatBuffer ()
150 return new FloatViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
153 public DoubleBuffer asDoubleBuffer ()
155 return new DoubleViewBufferImpl (this, position (), remaining(), remaining (), 0, -1, isReadOnly ());
158 public char getChar ()
160 throw new Error ("Not implemented");
163 public char getChar (int index)
165 throw new Error ("Not implemented");
168 public ByteBuffer putChar (char value)
170 throw new Error ("Not implemented");
173 public ByteBuffer putChar (int index, char value)
175 throw new Error ("Not implemented");
178 public double getDouble ()
180 throw new Error ("Not implemented");
183 public double getDouble (int index)
185 throw new Error ("Not implemented");
188 public ByteBuffer putDouble (double value)
190 throw new Error ("Not implemented");
193 public ByteBuffer putDouble (int index, double value)
195 throw new Error ("Not implemented");
198 public float getFloat ()
200 throw new Error ("Not implemented");
203 public float getFloat (int index)
205 throw new Error ("Not implemented");
208 public ByteBuffer putFloat (float value)
210 throw new Error ("Not implemented");
213 public ByteBuffer putFloat (int index, float value)
215 throw new Error ("Not implemented");
220 throw new Error ("Not implemented");
223 public int getInt (int index)
225 throw new Error ("Not implemented");
228 public ByteBuffer putInt (int value)
230 throw new Error ("Not implemented");
233 public ByteBuffer putInt (int index, int value)
235 throw new Error ("Not implemented");
238 public long getLong ()
240 throw new Error ("Not implemented");
243 public long getLong (int index)
245 throw new Error ("Not implemented");
248 public ByteBuffer putLong (long value)
250 throw new Error ("Not implemented");
253 public ByteBuffer putLong (int index, long value)
255 throw new Error ("Not implemented");
258 public short getShort ()
260 throw new Error ("Not implemented");
263 public short getShort (int index)
265 throw new Error ("Not implemented");
268 public ByteBuffer putShort (short value)
270 throw new Error ("Not implemented");
273 public ByteBuffer putShort (int index, short value)
275 throw new Error ("Not implemented");