Commit Graph

8 Commits

Author SHA1 Message Date
Dalibor Topic 23c41c0833 Buffer.java, [...]: Fixed javadocs all over.
2004-07-09  Dalibor Topic  <robilad@kaffe.org>

	* java/nio/Buffer.java,
	java/nio/ByteBuffer.java,
	java/nio/ByteBufferHelper.java,
	java/nio/ByteBufferImpl.java,
	java/nio/CharBuffer.java,
	java/nio/CharBufferImpl.java,
	java/nio/CharViewBufferImpl.java,
	java/nio/DirectByteBufferImpl.java,
	java/nio/DoubleBuffer.java,
	java/nio/DoubleBufferImpl.java,
	java/nio/DoubleViewBufferImpl.java,
	java/nio/FloatBuffer.java,
	java/nio/FloatBufferImpl.java,
	java/nio/FloatViewBufferImpl.java,
	java/nio/IntBuffer.java,
	java/nio/IntBufferImpl.java,
	java/nio/IntViewBufferImpl.java,
	java/nio/LongBuffer.java,
	java/nio/LongBufferImpl.java,
	java/nio/LongViewBufferImpl.java,
	java/nio/MappedByteBufferImpl.java,
	java/nio/ShortBuffer.java,
	java/nio/ShortBufferImpl.java,
	java/nio/ShortViewBufferImpl.java:
        Fixed javadocs all over. Improved input error
        checking.

	* java/nio/Buffer.java
	(checkForUnderflow, checkForOverflow, checkIndex,
	checkIfReadOnly, checkArraySize): New helper methods
        for error checking.

	* java/nio/ByteBufferHelper.java
	(checkRemainingForRead, checkRemainingForWrite,
	checkAvailableForRead, checkAvailableForWrite): Removed
        no longer needed methods.

From-SVN: r84366
2004-07-09 13:40:29 +00:00
Michael Koch 08c5d75719 ByteBufferImpl.java, [...]: Made sure all classes are final and removed final keyword from all methods.
2004-04-20  Michael Koch  <konqueror@gmx.de>

	* java/nio/ByteBufferImpl.java,
	java/nio/CharBufferImpl.java,
	java/nio/DirectByteBufferImpl.java,
	java/nio/DoubleBufferImpl.java,
	java/nio/DoubleViewBufferImpl.java,
	java/nio/FloatBufferImpl.java,
	java/nio/FloatViewBufferImpl.java,
	java/nio/IntBufferImpl.java,
	java/nio/IntViewBufferImpl.java,
	java/nio/LongBufferImpl.java,
	java/nio/LongViewBufferImpl.java,
	java/nio/MappedByteBufferImpl.java,
	java/nio/ShortBufferImpl.java,
	java/nio/ShortViewBufferImpl.java:
	Made sure all classes are final and removed final keyword from all
	methods.

From-SVN: r80907
2004-04-20 14:54:37 +00:00
Per Bothner 35d0b14df6 ByteBuffer.java (endian): Make non-private so other java.nio classes can inherit it.
* java/nio/ByteBuffer.java (endian):  Make non-private so other
	java.nio classes can inherit it.
	(<init>):  Don't bother clearing array_offset.
	* java/nio/ByteBuffer.java (allocate):  Re-implement using wrap.
	* java/nio/ByteBuffer.java (get(byte[],int,int)):  Check underflow.
	Remove redundant test.

	* java/nio/ByteBufferImpl.java (asCharBuffer, asShortBuffer,
	asIntBuffer, asLongBuffer, asFloatBuffer, asDoubleBuffer):
	Use new XxxViewBufferImpl constructors.
	* java/nio/MappedByteBufferImpl.java:  Likewise.
	* java/nio/DirectByteBufferImpl.java:  Likewise.

	* java/nio/ByteBufferImpl.java:  Remove one constructor.
	Inline super in remaining constructor.
	* java/nio/ByteBuffer.java:  Remove unused constructor.

	* java/nio/ByteBufferImpl.java (shiftDown):  New optimized method.

	* java/nio/ByteBufferImpl.java (get, put):  Add array_offset.
	* java/nio/DirectByteBufferImpl.java (owner):  New field.
	(offset):  Remove unused field.
	(<init>):  Modify one and add another constructor.  Change callers.
	(allocateDirect):  Removed - not used.
	(getImpl, putImpl):  Make static and pass address explicitly,
	to make them useful for MappedByteBufferImpl.
	(get, put):  Check for underflow.  Modify for new getImpl.
	(getImpl):  New native method where target is array.
	(get(byte[],int,int)):  Use the above.
	(adjustAddress):  New static native method.
	(slice, duplicate, asReadOnly):  New implementations.
	* java/nio/natDirectByteBufferImpl.cc (getImpl, putImpl, shiftDown,
	adjustAddress):  New or updated native methods.

From-SVN: r77919
2004-02-16 12:00:33 -08:00
Per Bothner 40c23042f4 ByteBuffer.java (shiftDown): New helper method.
* java/nio/ByteBuffer.java (shiftDown):  New helper method.
	* java/nio/natDirectByteBufferImpl.cc (shiftDown):  New implementation.
	* java/nio/ByteBufferImpl.java (compact):  Use new shiftDown method.
	* sava/nio/ByteBufferHelper.java:  Remove redundant 'final' specifiers.
	Pass ByteOrder parameter to most methods, since the underlying
	ByteBuffer's order isn't always what we should use.
	* java/nio/ByteBufferImpl.java:  Pass byte-order various places.
	* java/nio/DirectByteBufferImpl.java:  Likewise.
	Use ByteBufferHelper methods.
	* java/nio/MappedByteBufferImpl.java:  Likewise.
	(compact):  Use shiftDown.
	* java/nio/CharViewBufferImpl.java (<init>):  Pass byte-order.
	(get, put):  Use ByteBufferHelper.
	(compact):  Use new shiftDown method.
	(duplicate(boolean)):  New helper method.
	(duplicate, asReadOnlyBuffer):  Use it.
	(order):  Return endian field.
	* java/nio/DoubleViewBufferImpl.java:  Likewise.
	* java/nio/FloatViewBufferImpl.java:  Likewise.
	* java/nio/IntViewBufferImpl.java:  Likewise.
	* java/nio/LongViewBufferImpl.java:  Likewise.
	* java/nio/ShortViewBufferImpl.java:  Likewise.
	* java/nio/CharViewBufferImpl.java (subsequence):  Redundant test.
	* java/nio/DirectByteBufferImpl.java (shiftDown):  New native method.
	(compact):  Re-implement using shiftDown.

From-SVN: r77501
2004-02-08 13:02:53 -08:00
Michael Koch 5e2ba18bc1 ByteBufferHelper.java: New file.
2003-09-25  Michael Koch  <konqueror@gmx.de>

	* java/nio/ByteBufferHelper.java:
	New file.
	* java/nio/ByteBufferImpl.java,
	java/nio/DirectByteBufferImpl.java,
	java/nio/MappedByteBufferImpl.java
	(getType,putType): Use new helper class ByteBufferHelper.
	* Makefile.am (ordinary_java_source_files):
	Added java/nio/ByteBufferHelper.java.
	* Makefile.in: Regenerated.

From-SVN: r71757
2003-09-25 06:43:52 +00:00
Michael Koch 7318eb21d1 2003-08-02 Michael Koch <konqueror@gmx.de>
* java/nio/ByteBufferImpl.java
	(getChar): Check remaining bytes, fixed comment about endianess.
	(putChar): Likewise.
	(getShort): Likewise.
	(putShort): Likewise.
	(getInt): Check remaining bytes, fixed conversion, fixed comment about
	endianess.
	(putInt): Likewise.
	(getLong): Likewise.
	(putLong): Likewise.
	(getFloat): Likewise.
	(putFloat): Likewise.
	(getDouble): Likewise.
	(putDouble): Likewise.
	* java/nio/DirectByteBufferImpl.java
	(getChar): Wrapped code, fixed comment about endianess.
	(putchar): Likewise.
	(getShort): Likewise.
	(putShort): Likewise.
	(getInt): Fixed conversion, fixed comment about endianess.
	(putInt): Likewise.
	(getLong): Likewise.
	(putLong): Likewise.
	(getFloat): Likewise.
	(putFloat): Likewise.
	(getDouble): Likewise.
	(putDouble): Likewise.
	* java/nio/MappedByteBufferImpl.java
	(compact): Implemented.
	(getChar): Implemented.
	(putChar): Implemented.
	(getDouble): Implemented.
	(putdouble): Implemented.
	(getFloat): Implemented.
	(putFloat): Implemented.
	(getInt): Implemented.
	(putInt): Implemented.
	(getLong): Implemented.
	(putLong): Implemented.
	(getShort): Implemented.
	(putShort): Implemented.
	* java/nio/channels/FileChannelImpl.java
	(read): Set position where to access file.
	(write): Likewise.
	(transferTo): Flip buffer after read and before write.
	(transferFrom): Likewise.

From-SVN: r70102
2003-08-02 11:17:40 +00:00
Michael Koch 1226b900dc 2003-06-27 Michael Koch <konqueror@gmx.de>
* java/nio/ByteBufferImpl.java
	(ByteBufferImpl): Made it a package-private class
	* java/nio/CharBufferImpl.java
	(CharBufferImpl): Made it a package-private class
	* java/nio/DirectByteBufferImpl.java
	(DirectByteBufferImpl): Made it a package-private class
	* java/nio/DoubleBufferImpl.java
	(DoubleBufferImpl): Made it a package-private class
	* java/nio/FloatBufferImpl.java
	(FloatBufferImpl): Made it a package-private class
	* java/nio/IntBufferImpl.java
	(IntBufferImpl): Made it a package-private class
	* java/nio/LongBufferImpl.java
	(LongBufferImpl): Made it a package-private class
	* java/nio/ShortBufferImpl.java
	(ShortBufferImpl): Made it a package-private class
	* java/nio/channels/FileChannel.java
	(write): Made final.
	* java/nio/channels/ServerSocketChannel.java
	(ServerSocketChanne): Made protected.

From-SVN: r68571
2003-06-27 13:34:12 +00:00
Michael Koch 3a5eb28322 ByteBufferImpl.java, [...]: Moved files to java/nio.
2003-05-20  Michael Koch  <konqueror@gmx.de>

	* gnu/java/nio/ByteBufferImpl.java,
	gnu/java/nio/CharBufferImpl.java,
	gnu/java/nio/CharViewBufferImpl.java,
	gnu/java/nio/DirectByteBufferImpl.java,
	gnu/java/nio/DoubleBufferImpl.java,
	gnu/java/nio/DoubleViewBufferImpl.java,
	gnu/java/nio/FloatBufferImpl.java,
	gnu/java/nio/FloatViewBufferImpl.java,
	gnu/java/nio/IntBufferImpl.java,
	gnu/java/nio/IntViewBufferImpl.java,
	gnu/java/nio/LongBufferImpl.java,
	gnu/java/nio/LongViewBufferImpl.java,
	gnu/java/nio/natDirectByteBufferImpl.cc,
	gnu/java/nio/ShortBufferImpl.java,
	gnu/java/nio/ShortViewBufferImpl.java:
	Moved files to java/nio.
	* gnu/java/nio/SocketChannelImpl.java

	* java/nio/ByteBuffer.java,
	java/nio/CharBuffer.java,
	java/nio/DoubleBuffer.java,
	java/nio/FloatBuffer.java,
	java/nio/IntBuffer.java,
	java/nio/LongBuffer.java,
	java/nio/ShortBuffer.java:
	Dont import anything.
	* java/nio/ByteBufferImpl.java,
	java/nio/CharBufferImpl.java,
	java/nio/CharViewBufferImpl.java,
	java/nio/DirectByteBufferImpl.java,
	java/nio/DoubleBufferImpl.java,
	java/nio/DoubleViewBufferImpl.java,
	java/nio/FloatBufferImpl.java,
	java/nio/FloatViewBufferImpl.java,
	java/nio/IntBufferImpl.java,
	java/nio/IntViewBufferImpl.java,
	java/nio/LongBufferImpl.java,
	java/nio/LongViewBufferImpl.java,
	java/nio/natDirectByteBufferImpl.cc,
	java/nio/ShortBufferImpl.java,
	java/nio/ShortViewBufferImpl.java:
	Moved from gnu/java/nio.
	* Makefile.am
	(ordinary_java_source_files): Moved files from gnu/java/nio to
	java/nio.
	(nat_source_files): Moved natDirectByteBufferImpl.cc from gnu/java/nio
	to java/nio.
	* Makefile.in: Regenerated.

From-SVN: r66990
2003-05-20 08:58:31 +00:00