/[classpath]/classpath/gnu/java/nio/IntBufferImpl.java
ViewVC logotype

Diff of /classpath/gnu/java/nio/IntBufferImpl.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by mkoch, Mon Nov 25 07:50:52 2002 UTC revision 1.11 by mkoch, Tue Dec 3 13:23:51 2002 UTC
# Line 79  public final class IntBufferImpl extends Line 79  public final class IntBufferImpl extends
79      position(position() + a);      position(position() + a);
80    }    }
81    
82    private static native int[] nio_cast(byte[]copy);    private static native int[] nio_cast (byte[] copy);
83    private static native int[] nio_cast(char[]copy);    private static native int[] nio_cast (char[] copy);
84    private static native int[] nio_cast(short[]copy);    private static native int[] nio_cast (short[] copy);
85    private static native int[] nio_cast(long[]copy);    private static native int[] nio_cast (long[] copy);
86    private static native int[] nio_cast(int[]copy);    private static native int[] nio_cast (int[] copy);
87    private static native int[] nio_cast(float[]copy);    private static native int[] nio_cast (float[] copy);
88    private static native int[] nio_cast(double[]copy);    private static native int[] nio_cast (double[] copy);
89    
90    IntBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(IntBufferImpl b, int index, int limit); private static native void nio_put_Byte(IntBufferImpl b, int index, int limit, byte value); public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/4); return res; }    IntBufferImpl (byte[] copy)
91    IntBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(IntBufferImpl b, int index, int limit); private static native void nio_put_Char(IntBufferImpl b, int index, int limit, char value); public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }    {
92    IntBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(IntBufferImpl b, int index, int limit); private static native void nio_put_Short(IntBufferImpl b, int index, int limit, short value); public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/4); return res; }      this.backing_buffer = copy != null ? nio_cast (copy) : null;
93    IntBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(IntBufferImpl b, int index, int limit); private static native void nio_put_Int(IntBufferImpl b, int index, int limit, int value); public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }    }
94    IntBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(IntBufferImpl b, int index, int limit); private static native void nio_put_Long(IntBufferImpl b, int index, int limit, long value); public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }  
95    IntBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(IntBufferImpl b, int index, int limit); private static native void nio_put_Float(IntBufferImpl b, int index, int limit, float value); public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/4); return res; }    private static native byte nio_get_Byte (IntBufferImpl b, int index, int limit);
96    IntBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(IntBufferImpl b, int index, int limit); private static native void nio_put_Double(IntBufferImpl b, int index, int limit, double value); public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/4); return res; }  
97      private static native void nio_put_Byte (IntBufferImpl b, int index, int limit, byte value);
98    
99      public ByteBuffer asByteBuffer ()
100      {
101        ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
102        res.limit ((limit () * 1) / 4);
103        return res;
104      }
105    
106      IntBufferImpl (char[] copy)
107      {
108        this.backing_buffer = copy != null ? nio_cast (copy) : null;
109      }
110    
111      private static native char nio_get_Char (IntBufferImpl b, int index, int limit);
112    
113      private static native void nio_put_Char (IntBufferImpl b, int index, int limit, char value);
114    
115      public CharBuffer asCharBuffer ()
116      {
117        CharBufferImpl res = new CharBufferImpl (backing_buffer);
118        res.limit ((limit () * 2) / 4);
119        return res;
120      }
121    
122      IntBufferImpl (short[] copy)
123      {
124        this.backing_buffer = copy != null ? nio_cast (copy) : null;
125      }
126      
127      private static native short nio_get_Short (IntBufferImpl b, int index, int limit);
128    
129      private static native void nio_put_Short (IntBufferImpl b, int index, int limit, short value);
130    
131      public ShortBuffer asShortBuffer ()
132      {
133        ShortBufferImpl res = new ShortBufferImpl (backing_buffer);
134        res.limit ((limit () * 2) / 4);
135        return res;
136      }
137    
138      IntBufferImpl (int[] copy)
139      {
140        this.backing_buffer = copy != null ? nio_cast (copy) : null;
141      }
142    
143      private static native int nio_get_Int (IntBufferImpl b, int index, int limit);
144    
145      private static native void nio_put_Int (IntBufferImpl b, int index, int limit, int value);
146    
147      public IntBuffer asIntBuffer ()
148      {
149        IntBufferImpl res = new IntBufferImpl (backing_buffer);
150        res.limit ((limit () * 4) / 4);
151        return res;
152      }
153    
154      IntBufferImpl (long[] copy)
155      {
156        this.backing_buffer = copy != null ? nio_cast (copy) : null;
157      }
158    
159      private static native long nio_get_Long (IntBufferImpl b, int index, int limit);
160    
161      private static native void nio_put_Long (IntBufferImpl b, int index, int limit, long value);
162    
163      public LongBuffer asLongBuffer ()
164      {
165        LongBufferImpl res = new LongBufferImpl (backing_buffer);
166        res.limit ((limit () * 8) / 4);
167        return res;
168      }
169    
170      IntBufferImpl (float[] copy)
171      {
172        this.backing_buffer = copy != null ? nio_cast (copy) : null;
173      }
174    
175      private static native float nio_get_Float (IntBufferImpl b, int index, int limit);
176    
177      private static native void nio_put_Float (IntBufferImpl b, int index, int limit, float value);
178      
179      public FloatBuffer asFloatBuffer ()
180      {
181        FloatBufferImpl res = new FloatBufferImpl (backing_buffer);
182        res.limit ((limit () * 4) / 4);
183        return res;
184      }
185    
186      IntBufferImpl (double[] copy)
187      {
188        this.backing_buffer = copy != null ? nio_cast (copy) : null;
189      }
190    
191      private static native double nio_get_Double (IntBufferImpl b, int index, int limit);
192    
193      private static native void nio_put_Double (IntBufferImpl b, int index, int limit, double value);
194      
195      public DoubleBuffer asDoubleBuffer ()
196      {
197        DoubleBufferImpl res = new DoubleBufferImpl (backing_buffer);
198        res.limit ((limit () * 8) / 4);
199        return res;
200      }
201    
202    public boolean isReadOnly()    public boolean isReadOnly()
203    {    {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26