2003-05-09 Michael Koch <konqueror@gmx.de>

* gnu/java/nio/ByteBufferImpl.java
	(nio_cast): Removed.
	(ByteBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	(asCharBuffer): Removed implementation and throw exception.
	(asShortBuffer): Likewise.
	(asIntBuffer): Likewise.
	(asLongBuffer): Likewise.
	(asFloatBuffer): Likewise.
	(asDoubleBuffer): Likewise.
	* gnu/java/nio/CharBufferImpl.java
	(CharBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/DoubleBufferImpl.java
	(DoubleBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/FloatBufferImpl.java
	(FloatBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/IntBufferImpl.java
	(IntBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/LongBufferImpl.java
	(LongBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/ShortBufferImpl.java
	(ShortBufferImpl): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	(asByteBuffer): Removed.
	* gnu/java/nio/natByteBufferImpl.cc
	(nio_cast): Removed.
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.
	* gnu/java/nio/natCharBufferImpl.cc
	(nio_get_Byte): Removed.
	(nio_put_Byte): Removed.

From-SVN: r66626
This commit is contained in:
Michael Koch
2003-05-09 07:55:59 +00:00
committed by Michael Koch
parent 44db872cf5
commit 2c478ce37c
10 changed files with 58 additions and 269 deletions
+6 -86
View File
@@ -79,138 +79,58 @@ public final class ByteBufferImpl extends ByteBuffer
position (position () + toAdd);
}
private static native byte[] nio_cast(byte[]copy);
private static native byte[] nio_cast(char[]copy);
private static native byte[] nio_cast(short[]copy);
private static native byte[] nio_cast(long[]copy);
private static native byte[] nio_cast(int[]copy);
private static native byte[] nio_cast(float[]copy);
private static native byte[] nio_cast(double[]copy);
ByteBufferImpl (byte[] copy)
{
super (copy.length, copy.length, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native byte nio_get_Byte (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Byte (ByteBufferImpl b, int index, int limit, byte value);
public ByteBuffer asByteBuffer ()
{
ByteBufferImpl res = new ByteBufferImpl (backing_buffer);
res.limit ((limit () * 1) / 1);
return res;
}
ByteBufferImpl (char[] copy)
{
super (copy.length * 2, copy.length * 2, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native char nio_get_Char (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Char (ByteBufferImpl b, int index, int limit, char value);
public CharBuffer asCharBuffer ()
{
CharBufferImpl res = new CharBufferImpl (backing_buffer);
res.limit ((limit () * 2) / 1);
return res;
throw new Error ("Not implemented");
}
ByteBufferImpl (short[] copy)
{
super (copy.length, copy.length, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native short nio_get_Short (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Short (ByteBufferImpl b, int index, int limit, short value);
public ShortBuffer asShortBuffer ()
{
ShortBufferImpl res = new ShortBufferImpl (backing_buffer);
res.limit ((limit () * 2) / 1);
return res;
throw new Error ("Not implemented");
}
ByteBufferImpl (int[] copy)
{
super (copy.length * 4, copy.length * 4, 0, 0);
this.backing_buffer = copy != null ? nio_cast(copy) : null;
readOnly = false;
}
private static native int nio_get_Int (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Int (ByteBufferImpl b, int index, int limit, int value);
public IntBuffer asIntBuffer ()
{
IntBufferImpl res = new IntBufferImpl (backing_buffer);
res.limit ((limit() * 4) / 1);
return res;
throw new Error ("Not implemented");
}
ByteBufferImpl (long[] copy)
{
super (copy.length * 8, copy.length * 8, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native long nio_get_Long (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Long (ByteBufferImpl b, int index, int limit, long value);
public LongBuffer asLongBuffer ()
{
LongBufferImpl res = new LongBufferImpl (backing_buffer);
res.limit ((limit() * 8) / 1);
return res;
throw new Error ("Not implemented");
}
ByteBufferImpl (float[] copy)
{
super (copy.length * 4, copy.length * 4, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native float nio_get_Float (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Float (ByteBufferImpl b, int index, int limit, float value);
public FloatBuffer asFloatBuffer ()
{
FloatBufferImpl res = new FloatBufferImpl (backing_buffer);
res.limit ((limit() * 4) / 1);
return res;
throw new Error ("Not implemented");
}
ByteBufferImpl (double[] copy)
{
super (copy.length * 8, copy.length * 8, 0, 0);
this.backing_buffer = copy != null ? nio_cast (copy) : null;
readOnly = false;
}
private static native double nio_get_Double (ByteBufferImpl b, int index, int limit);
private static native void nio_put_Double (ByteBufferImpl b, int index, int limit, double value);
public DoubleBuffer asDoubleBuffer ()
{
DoubleBufferImpl res = new DoubleBufferImpl (backing_buffer);
res.limit ((limit () * 8) / 1);
return res;
throw new Error ("Not implemented");
}
public boolean isReadOnly()