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

Diff of /classpath/gnu/java/nio/ShortBufferImpl.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 ShortBufferImpl exten Line 79  public final class ShortBufferImpl exten
79      position(position() + a);      position(position() + a);
80    }    }
81    
82    private static native short[] nio_cast(byte[]copy);    private static native short[] nio_cast (byte[] copy);
83    private static native short[] nio_cast(char[]copy);    private static native short[] nio_cast (char[] copy);
84    private static native short[] nio_cast(short[]copy);    private static native short[] nio_cast (short[] copy);
85    private static native short[] nio_cast(long[]copy);    private static native short[] nio_cast (long[] copy);
86    private static native short[] nio_cast(int[]copy);    private static native short[] nio_cast (int[] copy);
87    private static native short[] nio_cast(float[]copy);    private static native short[] nio_cast (float[] copy);
88    private static native short[] nio_cast(double[]copy);    private static native short[] nio_cast (double[] copy);
89    
90    ShortBufferImpl(byte[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native byte nio_get_Byte(ShortBufferImpl b, int index, int limit); private static native void nio_put_Byte(ShortBufferImpl b, int index, int limit, byte value); public ByteBuffer asByteBuffer() { ByteBufferImpl res = new ByteBufferImpl(backing_buffer); res.limit((limit()*1)/2); return res; }    ShortBufferImpl (byte[] copy)
91    ShortBufferImpl(char[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native char nio_get_Char(ShortBufferImpl b, int index, int limit); private static native void nio_put_Char(ShortBufferImpl b, int index, int limit, char value); public CharBuffer asCharBuffer() { CharBufferImpl res = new CharBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }    {
92    ShortBufferImpl(short[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native short nio_get_Short(ShortBufferImpl b, int index, int limit); private static native void nio_put_Short(ShortBufferImpl b, int index, int limit, short value); public ShortBuffer asShortBuffer() { ShortBufferImpl res = new ShortBufferImpl(backing_buffer); res.limit((limit()*2)/2); return res; }      this.backing_buffer = copy != null ? nio_cast (copy) : null;
93    ShortBufferImpl(int[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native int nio_get_Int(ShortBufferImpl b, int index, int limit); private static native void nio_put_Int(ShortBufferImpl b, int index, int limit, int value); public IntBuffer asIntBuffer() { IntBufferImpl res = new IntBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }    }
94    ShortBufferImpl(long[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native long nio_get_Long(ShortBufferImpl b, int index, int limit); private static native void nio_put_Long(ShortBufferImpl b, int index, int limit, long value); public LongBuffer asLongBuffer() { LongBufferImpl res = new LongBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }    
95    ShortBufferImpl(float[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native float nio_get_Float(ShortBufferImpl b, int index, int limit); private static native void nio_put_Float(ShortBufferImpl b, int index, int limit, float value); public FloatBuffer asFloatBuffer() { FloatBufferImpl res = new FloatBufferImpl(backing_buffer); res.limit((limit()*4)/2); return res; }    private static native byte nio_get_Byte (ShortBufferImpl b, int index, int limit);
96    ShortBufferImpl(double[] copy) { this.backing_buffer = copy != null ? nio_cast(copy) : null; } private static native double nio_get_Double(ShortBufferImpl b, int index, int limit); private static native void nio_put_Double(ShortBufferImpl b, int index, int limit, double value); public DoubleBuffer asDoubleBuffer() { DoubleBufferImpl res = new DoubleBufferImpl(backing_buffer); res.limit((limit()*8)/2); return res; }    
97      private static native void nio_put_Byte (ShortBufferImpl 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) / 2);
103        return res;
104      }
105    
106      ShortBufferImpl (char[] copy)
107      {
108        this.backing_buffer = copy != null ? nio_cast (copy) : null;
109      }
110      
111      private static native char nio_get_Char (ShortBufferImpl b, int index, int limit);
112      
113      private static native void nio_put_Char (ShortBufferImpl 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) / 2);
119        return res;
120      }
121    
122      ShortBufferImpl (short[] copy)
123      {
124        this.backing_buffer = copy != null ? nio_cast (copy) : null;
125      }
126    
127      private static native short nio_get_Short (ShortBufferImpl b, int index, int limit);
128    
129      private static native void nio_put_Short (ShortBufferImpl 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) / 2); return res;
135      }
136    
137      ShortBufferImpl (int[] copy)
138      {
139        this.backing_buffer = copy != null ? nio_cast (copy) : null;
140      }
141    
142      private static native int nio_get_Int (ShortBufferImpl b, int index, int limit);
143    
144      private static native void nio_put_Int (ShortBufferImpl b, int index, int limit, int value);
145    
146      public IntBuffer asIntBuffer ()
147      {
148        IntBufferImpl res = new IntBufferImpl (backing_buffer);
149        res.limit ((limit () * 4) / 2);
150        return res;
151      }
152    
153      ShortBufferImpl (long[] copy)
154      {
155        this.backing_buffer = copy != null ? nio_cast (copy) : null;
156      }
157      
158      private static native long nio_get_Long (ShortBufferImpl b, int index, int limit);
159    
160      private static native void nio_put_Long (ShortBufferImpl b, int index, int limit, long value);
161    
162      public LongBuffer asLongBuffer ()
163      {
164        LongBufferImpl res = new LongBufferImpl (backing_buffer);
165        res.limit ((limit () * 8) / 2);
166        return res;
167      }
168    
169      ShortBufferImpl (float[] copy)
170      {
171        this.backing_buffer = copy != null ? nio_cast (copy) : null;
172      }
173    
174      private static native float nio_get_Float (ShortBufferImpl b, int index, int limit);
175    
176      private static native void nio_put_Float (ShortBufferImpl b, int index, int limit, float value);
177    
178      public FloatBuffer asFloatBuffer ()
179      {
180        FloatBufferImpl res = new FloatBufferImpl (backing_buffer);
181        res.limit ((limit () * 4) / 2);
182        return res;
183      }
184    
185      ShortBufferImpl (double[] copy)
186      {
187        this.backing_buffer = copy != null ? nio_cast (copy) : null;
188      }
189      
190      private static native double nio_get_Double (ShortBufferImpl b, int index, int limit);
191      
192      private static native void nio_put_Double (ShortBufferImpl b, int index, int limit, double value);
193      
194      public DoubleBuffer asDoubleBuffer ()
195      {
196        DoubleBufferImpl res = new DoubleBufferImpl (backing_buffer);
197        res.limit ((limit () * 8) / 2);
198        return res;
199      }
200    
201    public boolean isReadOnly()    public boolean isReadOnly()
202    {    {
# Line 102  public final class ShortBufferImpl exten Line 205  public final class ShortBufferImpl exten
205    
206    public ShortBuffer slice()    public ShortBuffer slice()
207    {    {
208      ShortBufferImpl A = new ShortBufferImpl(this);      ShortBufferImpl a = new ShortBufferImpl(this);
209      A.array_offset = position();      a.array_offset = position();
210      return A;      return a;
211    }    }
212    
213    public ShortBuffer duplicate()    public ShortBuffer duplicate()

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